<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>Loading Signed Exchanges</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<style data-fill-with="stylesheet">/******************************************************************************
 *                   Style sheet for the W3C specifications                   *
 *
 * Special classes handled by this style sheet include:
 *
 * Indices
 *   - .toc for the Table of Contents (<ol class="toc">)
 *     + <span class="secno"> for the section numbers
 *   - #toc for the Table of Contents (<nav id="toc">)
 *   - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
 *   - table.index for Index Tables (e.g. for properties or elements)
 *
 * Structural Markup
 *   - table.data for general data tables
 *     -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best results !
 *     -> use <table class='complex data'> for extra-complex tables
 *     -> use <td class='long'> for paragraph-length cell content
 *     -> use <td class='pre'> when manual line breaks/indentation would help readability
 *   - dl.switch for switch statements
 *   - ol.algorithm for algorithms (helps to visualize nesting)
 *   - .figure and .caption (HTML4) and figure and figcaption (HTML5)
 *     -> .sidefigure for right-floated figures
 *   - ins/del
 *
 * Code
 *   - pre and code
 *
 * Special Sections
 *   - .note       for informative notes             (div, p, span, aside, details)
 *   - .example    for informative examples          (div, p, pre, span)
 *   - .issue      for issues                        (div, p, span)
 *   - .assertion  for assertions                    (div, p, span)
 *   - .advisement for loud normative statements     (div, p, strong)
 *   - .annoying-warning for spec obsoletion notices (div, aside, details)
 *
 * Definition Boxes
 *   - pre.def   for WebIDL definitions
 *   - table.def for tables that define other entities (e.g. CSS properties)
 *   - dl.def    for definition lists that define other entitles (e.g. HTML elements)
 *
 * Numbering
 *   - .secno for section numbers in .toc and headings (<span class='secno'>3.2</span>)
 *   - .marker for source-inserted example/figure/issue numbers (<span class='marker'>Issue 4</span>)
 *   - ::before styled for CSS-generated issue/example/figure numbers:
 *     -> Documents wishing to use this only need to add
 *        figcaption::before,
 *        .caption::before { content: "Figure "  counter(figure) " ";  }
 *        .example::before { content: "Example " counter(example) " "; }
 *        .issue::before   { content: "Issue "   counter(issue) " ";   }
 *
 * Header Stuff (ignore, just don't conflict with these classes)
 *   - .head for the header
 *   - .copyright for the copyright
 *
 * Miscellaneous
 *   - .overlarge for things that should be as wide as possible, even if
 *     that overflows the body text area. This can be used on an item or
 *     on its container, depending on the effect desired.
 *     Note that this styling basically doesn't help at all when printing,
 *     since A4 paper isn't much wider than the max-width here.
 *     It's better to design things to fit into a narrower measure if possible.
 *   - js-added ToC jump links (see fixup.js)
 *
 ******************************************************************************/

/******************************************************************************/
/*                                   Body                                     */
/******************************************************************************/

	body {
		counter-reset: example figure issue;

		/* Layout */
		max-width: 50em;               /* limit line length to 50em for readability   */
		margin: 0 auto;                /* center text within page                     */
		padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel clients */
		padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for status flag     */

		/* Typography */
		line-height: 1.5;
		font-family: sans-serif;
		widows: 2;
		orphans: 2;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: auto;

		/* Colors */
		color: black;
		background: white top left fixed no-repeat;
		background-size: 25px auto;
	}


/******************************************************************************/
/*                         Front Matter & Navigation                          */
/******************************************************************************/

/** Header ********************************************************************/

	div.head { margin-bottom: 1em }
	div.head hr { border-style: solid; }

	div.head h1 {
		font-weight: bold;
		margin: 0 0 .1em;
		font-size: 220%;
	}

	div.head h2 { margin-bottom: 1.5em;}

/** W3C Logo ******************************************************************/

	.head .logo {
		float: right;
		margin: 0.4rem 0 0.2rem .4rem;
	}

	.head img[src*="logos/W3C"] {
		display: block;
		border: solid #1a5e9a;
		border-width: .65rem .7rem .6rem;
		border-radius: .4rem;
		background: #1a5e9a;
		color: white;
		font-weight: bold;
	}

	.head a:hover > img[src*="logos/W3C"],
	.head a:focus > img[src*="logos/W3C"] {
		opacity: .8;
	}

	.head a:active > img[src*="logos/W3C"] {
		background: #c00;
		border-color: #c00;
	}

	/* see also additional rules in Link Styling section */

/** Copyright *****************************************************************/

	p.copyright,
	p.copyright small { font-size: small }

/** Back to Top / ToC Toggle **************************************************/

	@media print {
		#toc-nav {
			display: none;
		}
	}
	@media not print {
		#toc-nav {
			position: fixed;
			z-index: 2;
			bottom: 0; left: 0;
			margin: 0;
			min-width: 1.33em;
			border-top-right-radius: 2rem;
			box-shadow: 0 0 2px;
			font-size: 1.5em;
			color: black;
		}
		#toc-nav > a {
			display: block;
			white-space: nowrap;

			height: 1.33em;
			padding: .1em 0.3em;
			margin: 0;

			background: white;
			box-shadow: 0 0 2px;
			border: none;
			border-top-right-radius: 1.33em;
			background: white;
		}
		#toc-nav > #toc-jump {
			padding-bottom: 2em;
			margin-bottom: -1.9em;
		}

		#toc-nav > a:hover,
		#toc-nav > a:focus {
			background: #f8f8f8;
		}
		#toc-nav > a:not(:hover):not(:focus) {
			color: #707070;
		}

		/* statusbar gets in the way on keyboard focus; remove once browsers fix */
		#toc-nav > a[href="#toc"]:not(:hover):focus:last-child {
			padding-bottom: 1.5rem;
		}

		#toc-nav:not(:hover) > a:not(:focus) > span + span {
			/* Ideally this uses :focus-within on #toc-nav */
			display: none;
		}
		#toc-nav > a > span + span {
			padding-right: 0.2em;
		}

		#toc-toggle-inline {
			vertical-align: 0.05em;
			font-size: 80%;
			color: gray;
			color: hsla(203,20%,40%,.7);
			border-style: none;
			background: transparent;
			position: relative;
		}
		#toc-toggle-inline:hover:not(:active),
		#toc-toggle-inline:focus:not(:active) {
			text-shadow: 1px 1px silver;
			top: -1px;
			left: -1px;
		}

		#toc-nav :active {
			color: #C00;
		}
	}

/** ToC Sidebar ***************************************************************/

	/* Floating sidebar */
	@media screen {
		body.toc-sidebar #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			max-width: 80%;
			max-width: calc(100% - 2em - 26px);
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body.toc-sidebar #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}
		body.toc-sidebar #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	/* Hide main scroller when only the ToC is visible anyway */
	@media screen and (max-width: 28em) {
		body.toc-sidebar {
			overflow: hidden;
		}
	}

	/* Sidebar with its own space */
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body:not(.toc-inline) #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}

		body:not(.toc-inline) {
			padding-left: 29em;
		}
		/* See also Overflow section at the bottom */

		body:not(.toc-inline) #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) {
			margin: 0 4em;
		}
	}

/******************************************************************************/
/*                                Sectioning                                  */
/******************************************************************************/

/** Headings ******************************************************************/

	h1, h2, h3, h4, h5, h6, dt {
		page-break-after: avoid;
		page-break-inside: avoid;
		font: 100% sans-serif;   /* Reset all font styling to clear out UA styles */
		font-family: inherit;    /* Inherit the font family. */
		line-height: 1.2;        /* Keep wrapped headings compact */
		hyphens: manual;         /* Hyphenated headings look weird */
	}

	h2, h3, h4, h5, h6 {
		margin-top: 3rem;
	}

	h1, h2, h3 {
		color: #005A9C;
		background: transparent;
	}

	h1 { font-size: 170%; }
	h2 { font-size: 140%; }
	h3 { font-size: 120%; }
	h4 { font-weight: bold; }
	h5 { font-style: italic; }
	h6 { font-variant: small-caps; }
	dt { font-weight: bold; }

/** Subheadings ***************************************************************/

	h1 + h2,
	#subtitle {
		/* #subtitle is a subtitle in an H2 under the H1 */
		margin-top: 0;
	}
	h2 + h3,
	h3 + h4,
	h4 + h5,
	h5 + h6 {
		margin-top: 1.2em; /* = 1 x line-height */
	}

/** Section divider ***********************************************************/

	:not(.head) > hr {
		font-size: 1.5em;
		text-align: center;
		margin: 1em auto;
		height: auto;
		border: transparent solid 0;
		background: transparent;
	}
	:not(.head) > hr::before {
		content: "\2727\2003\2003\2727\2003\2003\2727";
	}

/******************************************************************************/
/*                            Paragraphs and Lists                            */
/******************************************************************************/

	p {
		margin: 1em 0;
	}

	dd > p:first-child,
	li > p:first-child {
		margin-top: 0;
	}

	ul, ol {
		margin-left: 0;
		padding-left: 2em;
	}

	li {
		margin: 0.25em 0 0.5em;
		padding: 0;
	}

	dl dd {
		margin: 0 0 .5em 2em;
	}

	.head dd + dd { /* compact for header */
		margin-top: -.5em;
	}

	/* Style for algorithms */
	ol.algorithm ol:not(.algorithm),
	.algorithm > ol ol:not(.algorithm) {
	 border-left: 0.5em solid #DEF;
	}

	/* Put nice boxes around each algorithm. */
	[data-algorithm]:not(.heading) {
	  padding: .5em;
	  border: thin solid #ddd; border-radius: .5em;
	  margin: .5em calc(-0.5em - 1px);
	}
	[data-algorithm]:not(.heading) > :first-child {
	  margin-top: 0;
	}
	[data-algorithm]:not(.heading) > :last-child {
	  margin-bottom: 0;
	}

	/* Style for switch/case <dl>s */
	dl.switch > dd > ol.only,
	dl.switch > dd > .only > ol {
	 margin-left: 0;
	}
	dl.switch > dd > ol.algorithm,
	dl.switch > dd > .algorithm > ol {
	 margin-left: -2em;
	}
	dl.switch {
	 padding-left: 2em;
	}
	dl.switch > dt {
	 text-indent: -1.5em;
	 margin-top: 1em;
	}
	dl.switch > dt + dt {
	 margin-top: 0;
	}
	dl.switch > dt::before {
	 content: '\21AA';
	 padding: 0 0.5em 0 0;
	 display: inline-block;
	 width: 1em;
	 text-align: right;
	 line-height: 0.5em;
	}

/** Terminology Markup ********************************************************/


/******************************************************************************/
/*                                 Inline Markup                              */
/******************************************************************************/

/** Terminology Markup ********************************************************/
	dfn   { /* Defining instance */
		font-weight: bolder;
	}
	a > i { /* Instance of term */
		font-style: normal;
	}
	dt dfn code, code.idl {
		font-size: medium;
	}
	dfn var {
		font-style: normal;
	}

/** Change Marking ************************************************************/

	del { color: red;  text-decoration: line-through; }
	ins { color: #080; text-decoration: underline;    }

/** Miscellaneous improvements to inline formatting ***************************/

	sup {
		vertical-align: super;
		font-size: 80%
	}

/******************************************************************************/
/*                                    Code                                    */
/******************************************************************************/

/** General monospace/pre rules ***********************************************/

	pre, code, samp {
		font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
		font-size: .9em;
		page-break-inside: avoid;
		hyphens: none;
		text-transform: none;
	}
	pre code,
	code code {
		font-size: 100%;
	}

	pre {
		margin-top: 1em;
		margin-bottom: 1em;
		overflow: auto;
	}

/** Inline Code fragments *****************************************************/

  /* Do something nice. */

/******************************************************************************/
/*                                    Links                                   */
/******************************************************************************/

/** General Hyperlinks ********************************************************/

	/* We hyperlink a lot, so make it less intrusive */
	a[href] {
		color: #034575;
		text-decoration: none;
		border-bottom: 1px solid #707070;
		/* Need a bit of extending for it to look okay */
		padding: 0 1px 0;
		margin: 0 -1px 0;
	}
	a:visited {
		border-bottom-color: #BBB;
	}

	/* Use distinguishing colors when user is interacting with the link */
	a[href]:focus,
	a[href]:hover {
		background: #f8f8f8;
		background: rgba(75%, 75%, 75%, .25);
		border-bottom-width: 3px;
		margin-bottom: -2px;
	}
	a[href]:active {
		color: #C00;
		border-color: #C00;
	}

	/* Backout above styling for W3C logo */
	.head .logo,
	.head .logo a {
		border: none;
		text-decoration: none;
		background: transparent;
	}

/******************************************************************************/
/*                                    Images                                  */
/******************************************************************************/

	img {
		border-style: none;
	}

	/* For autogen numbers, add
	   .caption::before, figcaption::before { content: "Figure " counter(figure) ". "; }
	*/

	figure, .figure, .sidefigure {
		page-break-inside: avoid;
		text-align: center;
		margin: 2.5em 0;
	}
	.figure img,    .sidefigure img,    figure img,
	.figure object, .sidefigure object, figure object {
		max-width: 100%;
		margin: auto;
	}
	.figure pre, .sidefigure pre, figure pre {
		text-align: left;
		display: table;
		margin: 1em auto;
	}
	.figure table, figure table {
		margin: auto;
	}
	@media screen and (min-width: 20em) {
		.sidefigure {
			float: right;
			width: 50%;
			margin: 0 0 0.5em 0.5em
		}
	}
	.caption, figcaption, caption {
		font-style: italic;
		font-size: 90%;
	}
	.caption::before, figcaption::before, figcaption > .marker {
		font-weight: bold;
	}
	.caption, figcaption {
		counter-increment: figure;
	}

	/* DL list is indented 2em, but figure inside it is not */
	dd > .figure, dd > figure { margin-left: -2em }

/******************************************************************************/
/*                             Colored Boxes                                  */
/******************************************************************************/

	.issue, .note, .example, .assertion, .advisement, blockquote {
		padding: .5em;
		border: .5em;
		border-left-style: solid;
		page-break-inside: avoid;
	}
	span.issue, span.note {
		padding: .1em .5em .15em;
		border-right-style: solid;
	}

	.issue,
	.note,
	.example,
	.advisement,
	.assertion,
	blockquote {
		margin: 1em auto;
	}
	.note  > p:first-child,
	.issue > p:first-child,
	blockquote > :first-child {
		margin-top: 0;
	}
	blockquote > :last-child {
		margin-bottom: 0;
	}

/** Blockquotes ***************************************************************/

	blockquote {
		border-color: silver;
	}

/** Open issue ****************************************************************/

	.issue {
		border-color: #E05252;
		background: #FBE9E9;
		counter-increment: issue;
		overflow: auto;
	}
	.issue::before, .issue > .marker {
		text-transform: uppercase;
		color: #AE1E1E;
		padding-right: 1em;
		text-transform: uppercase;
	}
	/* Add .issue::before { content: "Issue " counter(issue) " "; } for autogen numbers,
	   or use class="marker" to mark up the issue number in source. */

/** Example *******************************************************************/

	.example {
		border-color: #E0CB52;
		background: #FCFAEE;
		counter-increment: example;
		overflow: auto;
		clear: both;
	}
	.example::before, .example > .marker {
		text-transform: uppercase;
		color: #827017;
		min-width: 7.5em;
		display: block;
	}
	/* Add .example::before { content: "Example " counter(example) " "; } for autogen numbers,
	   or use class="marker" to mark up the example number in source. */

/** Non-normative Note ********************************************************/

	.note {
		border-color: #52E052;
		background: #E9FBE9;
		overflow: auto;
	}

	.note::before, .note > .marker,
	details.note > summary::before,
	details.note > summary > .marker {
		text-transform: uppercase;
		display: block;
		color: hsl(120, 70%, 30%);
	}
	/* Add .note::before { content: "Note"; } for autogen label,
	   or use class="marker" to mark up the label in source. */

	details.note > summary {
		display: block;
		color: hsl(120, 70%, 30%);
	}
	details.note[open] > summary {
		border-bottom: 1px silver solid;
	}

/** Assertion Box *************************************************************/
	/*  for assertions in algorithms */

	.assertion {
		border-color: #AAA;
		background: #EEE;
	}

/** Advisement Box ************************************************************/
	/*  for attention-grabbing normative statements */

	.advisement {
		border-color: orange;
		border-style: none solid;
		background: #FFEECC;
	}
	strong.advisement {
		display: block;
		text-align: center;
	}
	.advisement > .marker {
		color: #B35F00;
	}

/** Spec Obsoletion Notice ****************************************************/
	/* obnoxious obsoletion notice for older/abandoned specs. */

	details {
		display: block;
	}
	summary {
		font-weight: bolder;
	}

	.annoying-warning:not(details),
	details.annoying-warning:not([open]) > summary,
	details.annoying-warning[open] {
		background: #fdd;
		color: red;
		font-weight: bold;
		padding: .75em 1em;
		border: thick red;
		border-style: solid;
		border-radius: 1em;
	}
	.annoying-warning :last-child {
		margin-bottom: 0;
	}

@media not print {
	details.annoying-warning[open] {
		position: fixed;
		left: 1em;
		right: 1em;
		bottom: 1em;
		z-index: 1000;
	}
}

	details.annoying-warning:not([open]) > summary {
		text-align: center;
	}

/** Entity Definition Boxes ***************************************************/

	.def {
		padding: .5em 1em;
		background: #DEF;
		margin: 1.2em 0;
		border-left: 0.5em solid #8CCBF2;
	}

/******************************************************************************/
/*                                    Tables                                  */
/******************************************************************************/

	th, td {
		text-align: left;
		text-align: start;
	}

/** Property/Descriptor Definition Tables *************************************/

	table.def {
		/* inherits .def box styling, see above */
		width: 100%;
		border-spacing: 0;
	}

	table.def td,
	table.def th {
		padding: 0.5em;
		vertical-align: baseline;
		border-bottom: 1px solid #bbd7e9;
	}

	table.def > tbody > tr:last-child th,
	table.def > tbody > tr:last-child td {
		border-bottom: 0;
	}

	table.def th {
		font-style: italic;
		font-weight: normal;
		padding-left: 1em;
		width: 3em;
	}

	/* For when values are extra-complex and need formatting for readability */
	table td.pre {
		white-space: pre-wrap;
	}

	/* A footnote at the bottom of a def table */
	table.def           td.footnote {
		padding-top: 0.6em;
	}
	table.def           td.footnote::before {
		content: " ";
		display: block;
		height: 0.6em;
		width: 4em;
		border-top: thin solid;
	}

/** Data tables (and properly marked-up index tables) *************************/
	/*
		 <table class="data"> highlights structural relationships in a table
		 when correct markup is used (e.g. thead/tbody, th vs. td, scope attribute)

		 Use class="complex data" for particularly complicated tables --
		 (This will draw more lines: busier, but clearer.)

		 Use class="long" on table cells with paragraph-like contents
		 (This will adjust text alignment accordingly.)
		 Alternately use class="longlastcol" on tables, to have the last column assume "long".
	*/

	table {
		word-wrap: normal;
		overflow-wrap: normal;
		hyphens: manual;
	}

	table.data,
	table.index {
		margin: 1em auto;
		border-collapse: collapse;
		border: hidden;
		width: 100%;
	}
	table.data caption,
	table.index caption {
		max-width: 50em;
		margin: 0 auto 1em;
	}

	table.data td,  table.data th,
	table.index td, table.index th {
		padding: 0.5em 1em;
		border-width: 1px;
		border-color: silver;
		border-top-style: solid;
	}

	table.data thead td:empty {
		padding: 0;
		border: 0;
	}

	table.data  thead,
	table.index thead,
	table.data  tbody,
	table.index tbody {
		border-bottom: 2px solid;
	}

	table.data colgroup,
	table.index colgroup {
		border-left: 2px solid;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		border-right: 2px solid;
		border-top: 1px solid silver;
		padding-right: 1em;
	}

	table.data th[colspan],
	table.data td[colspan] {
		text-align: center;
	}

	table.complex.data th,
	table.complex.data td {
		border: 1px solid silver;
		text-align: center;
	}

	table.data.longlastcol td:last-child,
	table.data td.long {
	 vertical-align: baseline;
	 text-align: left;
	}

	table.data img {
		vertical-align: middle;
	}


/*
Alternate table alignment rules

	table.data,
	table.index {
		text-align: center;
	}

	table.data  thead th[scope="row"],
	table.index thead th[scope="row"] {
		text-align: right;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		text-align: right;
	}

Possible extra rowspan handling

	table.data  tbody th[rowspan]:not([rowspan='1']),
	table.index tbody th[rowspan]:not([rowspan='1']),
	table.data  tbody td[rowspan]:not([rowspan='1']),
	table.index tbody td[rowspan]:not([rowspan='1']) {
		border-left: 1px solid silver;
	}

	table.data  tbody th[rowspan]:first-child,
	table.index tbody th[rowspan]:first-child,
	table.data  tbody td[rowspan]:first-child,
	table.index tbody td[rowspan]:first-child{
		border-left: 0;
		border-right: 1px solid silver;
	}
*/

/******************************************************************************/
/*                                  Indices                                   */
/******************************************************************************/


/** Table of Contents *********************************************************/

	.toc a {
		/* More spacing; use padding to make it part of the click target. */
		padding-top: 0.1rem;
		/* Larger, more consistently-sized click target */
		display: block;
		/* Reverse color scheme */
		color: black;
		border-color: #3980B5;
		border-bottom-width: 3px !important;
		margin-bottom: 0px !important;
	}
	.toc a:visited {
		border-color: #054572;
	}
	.toc a:not(:focus):not(:hover) {
		/* Allow colors to cascade through from link styling */
		border-bottom-color: transparent;
	}

	.toc, .toc ol, .toc ul, .toc li {
		list-style: none; /* Numbers must be inlined into source */
		/* because generated content isn't search/selectable and markers can't do multilevel yet */
		margin:  0;
		padding: 0;
		line-height: 1.1rem; /* consistent spacing */
	}

	/* ToC not indented until third level, but font style & margins show hierarchy */
	.toc > li             { font-weight: bold;   }
	.toc > li li          { font-weight: normal; }
	.toc > li li li       { font-size:   95%;    }
	.toc > li li li li    { font-size:   90%;    }
	.toc > li li li li .secno { font-size: 85%; }
	.toc > li li li li li { font-size:   85%;    }
	.toc > li li li li li .secno { font-size: 100%; }

	/* @supports not (display:grid) { */
		.toc > li             { margin: 1.5rem 0;    }
		.toc > li li          { margin: 0.3rem 0;    }
		.toc > li li li       { margin-left: 2rem;   }

		/* Section numbers in a column of their own */
		.toc .secno {
			float: left;
			width: 4rem;
			white-space: nowrap;
		}

		.toc li {
			clear: both;
		}

		:not(li) > .toc              { margin-left:  5rem; }
		.toc .secno                  { margin-left: -5rem; }
		.toc > li li li .secno       { margin-left: -7rem; }
		.toc > li li li li .secno    { margin-left: -9rem; }
		.toc > li li li li li .secno { margin-left: -11rem; }

		/* Tighten up indentation in narrow ToCs */
		@media (max-width: 30em) {
			:not(li) > .toc              { margin-left:  4rem; }
			.toc .secno                  { margin-left: -4rem; }
			.toc > li li li              { margin-left:  1rem; }
			.toc > li li li .secno       { margin-left: -5rem; }
			.toc > li li li li .secno    { margin-left: -6rem; }
			.toc > li li li li li .secno { margin-left: -7rem; }
		}
	/* } */

	@supports (display:grid) and (display:contents) {
		/* Use #toc over .toc to override non-@supports rules. */
		#toc {
			display: grid;
			align-content: start;
			grid-template-columns: auto 1fr;
			grid-column-gap: 1rem;
			column-gap: 1rem;
			grid-row-gap: .6rem;
			row-gap: .6rem;
		}
		#toc h2 {
			grid-column: 1 / -1;
			margin-bottom: 0;
		}
		#toc ol,
		#toc li,
		#toc a {
			display: contents;
			/* Switch <a> to subgrid when supported */
		}
		#toc span {
			margin: 0;
		}
		#toc > .toc > li > a > span {
			/* The spans of the top-level list,
			   comprising the first items of each top-level section. */
			margin-top: 1.1rem;
		}
		#toc#toc .secno { /* Ugh, need more specificity to override base.css */
			grid-column: 1;
			width: auto;
			margin-left: 0;
		}
		#toc .content {
			grid-column: 2;
			width: auto;
			margin-right: 1rem;
		}
		#toc .content:hover {
			background: rgba(75%, 75%, 75%, .25);
			border-bottom: 3px solid #054572;
			margin-bottom: -3px;
		}
		#toc li li li .content {
			margin-left: 1rem;
		}
		#toc li li li li .content {
			margin-left: 2rem;
		}
	}


/** Index *********************************************************************/

	/* Index Lists: Layout */
	ul.index       { margin-left: 0; columns: 15em; text-indent: 1em hanging; }
	ul.index li    { margin-left: 0; list-style: none; break-inside: avoid; }
	ul.index li li { margin-left: 1em }
	ul.index dl    { margin-top: 0; }
	ul.index dt    { margin: .2em 0 .2em 20px;}
	ul.index dd    { margin: .2em 0 .2em 40px;}
	/* Index Lists: Typography */
	ul.index ul,
	ul.index dl { font-size: smaller; }
	@media not print {
		ul.index li span {
			white-space: nowrap;
			color: transparent; }
		ul.index li a:hover + span,
		ul.index li a:focus + span {
			color: #707070;
		}
	}

/** Index Tables *****************************************************/
	/* See also the data table styling section, which this effectively subclasses */

	table.index {
		font-size: small;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		margin: 1em 0;
	}

	table.index td,
	table.index th {
		padding: 0.4em;
	}

	table.index tr:hover td:not([rowspan]),
	table.index tr:hover th:not([rowspan]) {
		background: #f7f8f9;
	}

	/* The link in the first column in the property table (formerly a TD) */
	table.index th:first-child a {
		font-weight: bold;
	}

/******************************************************************************/
/*                                    Print                                   */
/******************************************************************************/

	@media print {
		/* Pages have their own margins. */
		html {
			margin: 0;
		}
		/* Serif for print. */
		body {
			font-family: serif;
		}
	}
	@page {
		margin: 1.5cm 1.1cm;
	}

/******************************************************************************/
/*                                    Legacy                                  */
/******************************************************************************/

	/* This rule is inherited from past style sheets. No idea what it's for. */
	.hide { display: none }



/******************************************************************************/
/*                             Overflow Control                               */
/******************************************************************************/

	.figure .caption, .sidefigure .caption, figcaption {
		/* in case figure is overlarge, limit caption to 50em */
		max-width: 50rem;
		margin-left: auto;
		margin-right: auto;
	}
	.overlarge {
		/* Magic to create good table positioning:
		   "content column" is 50ems wide at max; less on smaller screens.
		   Extra space (after ToC + content) is empty on the right.

		   1. When table < content column, centers table in column.
		   2. When content < table < available, left-aligns.
		   3. When table > available, fills available + scroll bar.
		*/ 
		display: grid;
		grid-template-columns: minmax(0, 50em);
	}
	.overlarge > table {
		/* limit preferred width of table */
		max-width: 50em;
		margin-left: auto;
		margin-right: auto;
	}

	@media (min-width: 55em) {
		.overlarge {
			margin-right: calc(13px + 26.5rem - 50vw);
			max-width: none;
		}
	}
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) .overlarge {
			/* 30.5em body padding 50em content area */
			margin-right: calc(40em - 50vw) !important;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) .overlarge {
			/* 4em html margin 30.5em body padding 50em content area */
			margin-right: calc(84.5em - 100vw) !important;
		}
	}

	@media not print {
		.overlarge {
			overflow-x: auto;
			/* See Lea Verou's explanation background-attachment:
			 * http://lea.verou.me/2012/04/background-attachment-local/
			 *
			background: top left  / 4em 100% linear-gradient(to right,  #ffffff, rgba(255, 255, 255, 0)) local,
			            top right / 4em 100% linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)) local,
			            top left  / 1em 100% linear-gradient(to right,  #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            top right / 1em 100% linear-gradient(to left, #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            white;
			background-repeat: no-repeat;
			*/
		}
	}
</style>
  <link href="https://www.w3.org/StyleSheets/TR/2016/W3C-ED" rel="stylesheet">
  <link href="https://wicg.github.io/webpackage/loading.html" rel="canonical">
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */

.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"></p>
   <h1 class="p-name no-ref" id="title">Loading Signed Exchanges</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://wicg.github.io/webpackage/loading.html">https://wicg.github.io/webpackage/loading.html</a>
     <dt class="editor">Editor:
     <dd class="editor p-author h-card vcard" data-editor-id="72192"><a class="p-name fn u-email email" href="mailto:jyasskin@chromium.org">Jeffrey Yasskin</a> (<a class="p-org org" href="https://google.com/">Google Inc.</a>)
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 the Contributors to the Loading Signed Exchanges Specification, published by the <a href="https://www.w3.org/community/wicg/">Web Platform Incubator Community Group</a> under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a>.
A human-readable <a href="http://www.w3.org/community/about/agreements/cla-deed/">summary</a> is available. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>How UAs load signed exchanges.</p>
  </div>
  <div data-fill-with="at-risk"></div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This specification was published by the <a href="https://www.w3.org/community/wicg/">Web Platform Incubator Community Group</a>.
  It is not a W3C Standard nor is it on the W3C Standards Track.

  Please note that under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a> there is a limited opt-out and other conditions apply.

  Learn more about <a href="http://www.w3.org/community/">W3C Community and Business Groups</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li>
     <a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
     <ol class="toc">
      <li><a href="#overview"><span class="secno">1.1</span> <span class="content">Overview</span></a>
      <li><a href="#details"><span class="secno">1.2</span> <span class="content">Other interesting details</span></a>
     </ol>
    <li>
     <a href="#monkeypatches"><span class="secno">2</span> <span class="content">Fetch monkeypatches</span></a>
     <ol class="toc">
      <li><a href="#mp-request-stashed-exchange"><span class="secno">2.1</span> <span class="content">A request’s stashed exchange</span></a>
      <li><a href="#mp-request-clone"><span class="secno">2.2</span> <span class="content">Request clone</span></a>
      <li><a href="#mp-response-date"><span class="secno">2.3</span> <span class="content">Response date</span></a>
      <li><a href="#mp-http-fetch"><span class="secno">2.4</span> <span class="content">Monkeypatch HTTP fetch</span></a>
      <li><a href="#mp-http-network-or-cache-fetch"><span class="secno">2.5</span> <span class="content">Monkeypatch HTTP-network-or-cache fetch</span></a>
     </ol>
    <li>
     <a href="#structs"><span class="secno">3</span> <span class="content">Structures</span></a>
     <ol class="toc">
      <li><a href="#exchange"><span class="secno">3.1</span> <span class="content">Exchange</span></a>
      <li><a href="#read-buffer"><span class="secno">3.2</span> <span class="content">Read buffer</span></a>
      <li><a href="#augmented-certificate"><span class="secno">3.3</span> <span class="content">Augmented Certificate</span></a>
      <li><a href="#signed-exchange-report"><span class="secno">3.4</span> <span class="content">Signed Exchange report</span></a>
      <li><a href="#exchange-signature"><span class="secno">3.5</span> <span class="content">Exchange Signature</span></a>
     </ol>
    <li>
     <a href="#algorithms"><span class="secno">4</span> <span class="content">Algorithms</span></a>
     <ol class="toc">
      <li><a href="#identifying-sxg"><span class="secno">4.1</span> <span class="content">Identifying signed exchanges</span></a>
      <li><a href="#parsing-fallback"><span class="secno">4.2</span> <span class="content">Extracting the fallback URL</span></a>
      <li><a href="#parsing"><span class="secno">4.3</span> <span class="content">Parsing signed exchanges</span></a>
      <li><a href="#parsing-prefix"><span class="secno">4.4</span> <span class="content">Parsing the invariant prefix</span></a>
      <li>
       <a href="#parsing-signature"><span class="secno">4.5</span> <span class="content">Parsing a Signature Header Field</span></a>
       <ol class="toc">
        <li><a href="#handling-cert-url"><span class="secno">4.5.1</span> <span class="content">Handling the certificate reference</span></a>
       </ol>
      <li><a href="#the-signed-message"><span class="secno">4.6</span> <span class="content">The signed message</span></a>
      <li><a href="#validating-signature"><span class="secno">4.7</span> <span class="content">Validating a signature</span></a>
      <li><a href="#cross-origin-trust"><span class="secno">4.8</span> <span class="content">Cross-origin trust</span></a>
      <li><a href="#trusting-certificate"><span class="secno">4.9</span> <span class="content">Establishing trust in a certificate</span></a>
      <li><a href="#parse-b2-cbor-headers"><span class="secno">4.10</span> <span class="content">Parsing b2 CBOR headers</span></a>
      <li>
       <a href="#parse-cbor-headers"><span class="secno">4.11</span> <span class="content">Parsing b3 CBOR headers</span></a>
       <ol class="toc">
        <li><a href="#headers-from-map"><span class="secno">4.11.1</span> <span class="content">Converting a map to a header list</span></a>
       </ol>
      <li><a href="#read-a-body"><span class="secno">4.12</span> <span class="content">Creating the response stream.</span></a>
      <li><a href="#request-matching"><span class="secno">4.13</span> <span class="content">Request matching</span></a>
      <li><a href="#create-a-new-report"><span class="secno">4.14</span> <span class="content">Create a new signed exchange report</span></a>
      <li><a href="#wait-and-queue-a-report"><span class="secno">4.15</span> <span class="content">Wait and queue a report</span></a>
      <li><a href="#queue-report"><span class="secno">4.16</span> <span class="content">Queuing signed exchange report</span></a>
      <li>
       <a href="#stream-algs"><span class="secno">4.17</span> <span class="content">Stream algorithms</span></a>
       <ol class="toc">
        <li><a href="#create-read-buffer"><span class="secno">4.17.1</span> <span class="content">Create a read buffer</span></a>
        <li><a href="#read-up-to-bytes"><span class="secno">4.17.2</span> <span class="content">Read up to bytes</span></a>
        <li><a href="#read-bytes"><span class="secno">4.17.3</span> <span class="content">Read bytes</span></a>
        <li><a href="#dump-stream"><span class="secno">4.17.4</span> <span class="content">Dump to another stream</span></a>
       </ol>
     </ol>
    <li>
     <a href="#seccons"><span class="secno">5</span> <span class="content">Security Considerations</span></a>
     <ol class="toc">
      <li><a href="#seccons-ct"><span class="secno">5.1</span> <span class="content">Certificate Transparency</span></a>
     </ol>
    <li><a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <section class="non-normative">
    <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
    <p><em>This section is non-normative.</em></p>
    <p>The Signed Exchanges specification <a data-link-type="biblio" href="#biblio-draft-yasskin-http-origin-signed-responses">[draft-yasskin-http-origin-signed-responses]</a> describes a way to provide one or
more signatures for an HTTP exchange and to check whether any of those
signatures is trusted as authoritative for a particular origin. This
specification describes how web browsers load those exchanges. It is expressed
as several monkeypatches to the <a data-link-type="biblio" href="#biblio-fetch">[FETCH]</a> specification which call algorithms
defined here.</p>
    <h3 class="heading settled" data-level="1.1" id="overview"><span class="secno">1.1. </span><span class="content">Overview</span><a class="self-link" href="#overview"></a></h3>
    <p>When fetching a resource (<code>https://distributor.example.org/foo.sxg</code>) with the <code>application/signed-exchange</code> <a data-link-type="dfn" href="https://mimesniff.spec.whatwg.org/#mime-type" id="ref-for-mime-type">MIME type</a>, the UA parses it, checks its
signatures, and then if all is well, redirects to its request URL
(<code>https://publisher.example.org/foo</code>) with a "stashed" exchange attached to the
request. The redirect applies all the usual processing, and then when it would
normally check for an HTTP cache hit, it also checks whether the stashed request
matches the redirected request and which of the stashed exchange or HTTP cache
contents is newer. If the stashed exchange matches and is newer, the UA returns
the stashed response.</p>
    <p>A Service Worker for <code>https://distributor.example.org/</code> gets to handle the
original request. A Service Worker for <code>https://publisher.example.org/</code> can then
handle the redirect. If it needs to know that signed exchange content is
available for the request it’s handling, it has two options:</p>
    <ol>
     <li data-md>
      <p>If <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#dom-serviceworkerregistration-navigationpreload" id="ref-for-dom-serviceworkerregistration-navigationpreload">navigationPreload</a></code> is enabled, the signed
response will be available in the <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#fetchevent" id="ref-for-fetchevent">FetchEvent</a></code>'s <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#dom-fetchevent-preloadresponse" id="ref-for-dom-fetchevent-preloadresponse">preloadResponse</a></code>. Note that this will also cause a network
request for requests that aren’t served from a signed exchange.</p>
     <li data-md>
      <p><code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-request-clone" id="ref-for-dom-request-clone">clone()</a></code> the <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#dom-fetchevent-request" id="ref-for-dom-fetchevent-request">request</a></code> and set its <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-request-cache" id="ref-for-dom-request-cache">cache</a></code> to <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-requestcache-only-if-cached" id="ref-for-dom-requestcache-only-if-cached">"only-if-cached"</a></code>, to retrieve the matching response from
either the signed exchange or the HTTP cache. Note that <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-global-fetch" id="ref-for-dom-global-fetch">fetch()</a></code>ing a <em>new</em> <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request">Request</a></code> with the same <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-request-url" id="ref-for-dom-request-url">url</a></code> will <em>not</em> retrieve the response from the signed exchange.</p>
    </ol>
    <h3 class="heading settled" data-level="1.2" id="details"><span class="secno">1.2. </span><span class="content">Other interesting details</span><a class="self-link" href="#details"></a></h3>
    <ul>
     <li data-md>
      <p>Like with <code>&lt;link rel="prefetch"></code> and <code>&lt;link rel="preload"></code>, the UA will use
the stashed response even if its HTTP cache headers have expired. This makes
it easier to specify that the contents of the signed exchange don’t wind up
in the HTTP cache before our security reviewers have gotten comfortable with
that idea. The publisher can still control resource expiration by setting
the Signature header’s <a data-link-type="dfn" href="#exchange-signature-expiration-time" id="ref-for-exchange-signature-expiration-time">expiration time</a> to the cache
expiration time if that’s sooner than they’d otherwise have the signature
expire.</p>
    </ul>
   </section>
   <h2 class="heading settled" data-level="2" id="monkeypatches"><span class="secno">2. </span><span class="content">Fetch monkeypatches</span><a class="self-link" href="#monkeypatches"></a></h2>
   <p>When fetching a signed exchange, the UA needs to look for a trusted and valid
signature and then redirect to the contained resource. We don’t put the
contained resource in the HTTP cache, so redirects get a new field to store it.</p>
   <h3 class="heading settled" data-level="2.1" id="mp-request-stashed-exchange"><span class="secno">2.1. </span><span class="content">A request’s stashed exchange</span><a class="self-link" href="#mp-request-stashed-exchange"></a></h3>
   <p>A <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request">request</a> has an associated <dfn class="dfn-paneled" data-dfn-for="request" data-dfn-type="dfn" data-noexport id="request-stashed-exchange">stashed exchange</dfn>, which
is null or an <a data-link-type="dfn" href="#exchange" id="ref-for-exchange">exchange</a>.</p>
   <h3 class="heading settled algorithm" data-algorithm="Request clone" data-level="2.2" id="mp-request-clone"><span class="secno">2.2. </span><span class="content">Request clone</span><a class="self-link" href="#mp-request-clone"></a></h3>
   <p>Rewrite <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-clone" id="ref-for-concept-request-clone">clone a request</a> to run these steps:</p>
   <ol>
    <li>
     Let <var>newRequest</var> be a copy of <var>request</var>, except for its <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body">body</a> 
     <ins>and <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange">stashed exchange</a></ins>
     . 
    <li>If <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body①">body</a> is non-null, set <var>newRequest</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body②">body</a> to the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-clone" id="ref-for-concept-body-clone">cloning</a> <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body③">body</a>. 
    <li>
     <ins>If <var>request</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange①">stashed exchange</a> is non-null, set <var>newRequest</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange②">stashed exchange</a> to an exchange whose <a data-link-type="dfn" href="#exchange-request-url" id="ref-for-exchange-request-url">request URL</a> is a copy of <var>request</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange③">stashed
  exchange</a>'s <a data-link-type="dfn" href="#exchange-request-url" id="ref-for-exchange-request-url①">request URL</a> and whose <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response">response</a> is the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-clone" id="ref-for-concept-response-clone">clone</a> of <var>request</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange④">stashed exchange</a>'s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response①">response</a>.</ins>
    <li>Return <var>newRequest</var>. 
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Response date" data-level="2.3" id="mp-response-date"><span class="secno">2.3. </span><span class="content">Response date</span><a class="self-link" href="#mp-response-date"></a></h3>
   <p>A <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response">response</a> <var>response</var>’s <dfn class="dfn-paneled" data-dfn-for="response" data-dfn-type="dfn" data-noexport id="response-date">date</dfn> is the result of:</p>
   <ol>
    <li data-md>
     <p>Let <var>date</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#extract-header-list-values" id="ref-for-extract-header-list-values">extracting header list values</a> given <code>`Date`</code> and <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list">header list</a>.</p>
    <li data-md>
     <p>If <var>date</var> is a failure, return the point in time of the beginning of the
universe.</p>
    <li data-md>
     <p>Return the point in time represented by <var>date</var>, as interpreted for the <a data-link-type="http-header" href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" id="ref-for-section-7.1.1.2">Date</a> header field.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Monkeypatch HTTP fetch" data-level="2.4" id="mp-http-fetch"><span class="secno">2.4. </span><span class="content">Monkeypatch HTTP fetch</span><a class="self-link" href="#mp-http-fetch"></a></h3>
   <p>In <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-http-fetch" id="ref-for-concept-http-fetch">HTTP fetch</a>, before</p>
   <blockquote>
    <ol start="5">
     <li data-md>
      <p>If <var>actualResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status">status</a> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#redirect-status" id="ref-for-redirect-status">redirect status</a>, then:
...</p>
    </ol>
   </blockquote>
   <p>add the following steps:</p>
   <ol start="5">
    <li data-md>
     <p>If the <a data-link-type="dfn" href="#signed-exchange-version" id="ref-for-signed-exchange-version">signed exchange version</a> of <var>actualResponse</var> is:</p>
     <dl class="switch">
      <dt data-md>undefined
      <dd data-md>
       <p>Do nothing.</p>
      <dt data-md><code>"b2"</code> or <code>"b3"</code>
      <dd data-md>
       <ol>
        <li data-md>
         <p>Let <var>report</var> be the result of <a data-link-type="dfn" href="#create-a-new-signed-exchange-report" id="ref-for-create-a-new-signed-exchange-report">create a new signed exchange report</a> with <var>request</var> and <var>actualResponse</var>.</p>
        <li data-md>
         <p>Let <var>parsedExchange</var> be the result of <a data-link-type="dfn" href="#parsing-a-signed-exchange" id="ref-for-parsing-a-signed-exchange">parsing a signed
exchange</a> of version <code>b2</code> or <code>b3</code>, respectively, from <var>actualResponse</var> in the context of <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client" id="ref-for-concept-request-client">client</a>,
reporting to <var>report</var>.</p>
        <li data-md>
         <p>If <var>parsedExchange</var> is not an <a data-link-type="dfn" href="#exchange" id="ref-for-exchange①">exchange</a>, run <a data-link-type="dfn" href="#queue-a-signed-exchange-report" id="ref-for-queue-a-signed-exchange-report">queue a signed exchange report</a> <var>report</var> with <var>parsedExchange</var> as the result, and return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error">network error</a>.</p>
        <li data-md>
         <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel">In parallel</a>, <a data-link-type="dfn" href="#wait-and-queue-a-report-for" id="ref-for-wait-and-queue-a-report-for">wait and queue a report for</a> <var>parsedExchange</var> and <var>report</var>.</p>
        <li data-md>
         <p>Set <var>actualResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-status" id="ref-for-concept-status">status</a> to <code>303</code>.</p>
        <li data-md>
         <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-set" id="ref-for-concept-header-list-set">Set</a> <var>actualResponse</var>’s <code>`Location`</code> header to
the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-encode" id="ref-for-ascii-encode">ASCII encoding</a> of the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer">serialization</a> of <var>parsedExchange</var>’s <a data-link-type="dfn" href="#exchange-request-url" id="ref-for-exchange-request-url②">request URL</a>.</p>
        <li data-md>
         <p>Set <var>request</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange⑤">stashed exchange</a> to <var>parsedExchange</var>.</p>
       </ol>
      <dt data-md>Anything else
      <dd data-md>
       <ol>
        <li data-md>
         <p>Let <var>fallbackUrlBytes</var> be the result of <a data-link-type="dfn" href="#extracting-the-fallback-url" id="ref-for-extracting-the-fallback-url">extracting the fallback
URL</a> from <var>actualResponse</var>.</p>
        <li data-md>
         <p>If <var>fallbackUrlBytes</var> is a failure, return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error①">network error</a>.</p>
        <li data-md>
         <p>Set <var>actualResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-status" id="ref-for-concept-status①">status</a> to <code>303</code>.</p>
        <li data-md>
         <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-set" id="ref-for-concept-header-list-set①">Set</a> <var>actualResponse</var>’s <code>`Location`</code> header to <var>fallbackUrlBytes</var>.</p>
       </ol>
     </dl>
     <p class="note" role="note"><span>Note:</span> The final <a data-link-type="biblio" href="#biblio-draft-yasskin-http-origin-signed-responses">[draft-yasskin-http-origin-signed-responses]</a> will use a
version of <code>`1`</code>, but this specification tracks what’s actually
implemented in browsers, which still uses draft versions.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Monkeypatch HTTP-network-or-cache fetch" data-level="2.5" id="mp-http-network-or-cache-fetch"><span class="secno">2.5. </span><span class="content">Monkeypatch HTTP-network-or-cache fetch</span><a class="self-link" href="#mp-http-network-or-cache-fetch"></a></h3>
   <p>In <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-http-network-or-cache-fetch" id="ref-for-concept-http-network-or-cache-fetch">HTTP-network-or-cache fetch</a>, after</p>
   <blockquote>
    <p>5.19. If <var>httpRequest</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-cache-mode" id="ref-for-concept-request-cache-mode">cache mode</a> is neither "<code>no-store</code>" nor
"<code>reload</code>", then: ...</p>
   </blockquote>
   <p>add the following steps:</p>
   <ol start="20">
    <li data-md>
     <p>If <var>httpRequest</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange⑥">stashed exchange</a> isn’t null:</p>
     <ol>
      <li data-md>
       <p>Let <var>stashedExchange</var> be <var>httpRequest</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange⑦">stashed exchange</a>.</p>
      <li data-md>
       <p>If</p>
       <ul>
        <li data-md>
         <p><var>httpRequest</var> <a data-link-type="dfn" href="#matches-the-stored-exchange" id="ref-for-matches-the-stored-exchange">matches the stored exchange</a> <var>stashedExchange</var> and</p>
        <li data-md>
         <p><var>response</var> is null or <var>response</var>’s <a data-link-type="dfn" href="#response-date" id="ref-for-response-date">date</a> is earlier than <var>httpRequest</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange⑧">stashed exchange</a>'s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response②">response</a>'s <a data-link-type="dfn" href="#response-date" id="ref-for-response-date①">date</a></p>
       </ul>
       <p>then set <var>response</var> to <var>httpRequest</var>’s <a data-link-type="dfn" href="#request-stashed-exchange" id="ref-for-request-stashed-exchange⑨">stashed exchange</a>'s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response③">response</a>.</p>
      <li data-md>
       <p>If <var>response</var> is null and <var>httpRequest</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-initiator" id="ref-for-concept-request-initiator">initiator</a> is
"<code>prefetch</code>" or "<code>preload</code>", return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error②">network error</a>.</p>
       <p class="note" role="note"><span>Note:</span> This ensures that prefetching a signed exchange from one origin
won’t accidentally do a network request from another origin, which could <a href="https://wicg.github.io/webpackage/draft-yasskin-wpack-use-cases.html#private-prefetch">compromise the user’s
privacy</a>.</p>
     </ol>
   </ol>
   <p class="note" role="note"><span>Note:</span> Applying the signed exchange’s response here has the effect of letting a
newer HTTP cache entry override a signed exchange’s content, and of not storing
the signed exchange’s response in the HTTP cache.</p>
   <h2 class="heading settled" data-level="3" id="structs"><span class="secno">3. </span><span class="content">Structures</span><a class="self-link" href="#structs"></a></h2>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export data-level="3.1" data-lt="Exchange" id="exchange"><span class="secno">3.1. </span><span class="content">Exchange</span></h3>
   <p>An exchange is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#struct" id="ref-for-struct">struct</a> with the following items:</p>
   <ul>
    <li data-md>
     <p><dfn class="dfn-paneled" data-dfn-for="exchange" data-dfn-type="dfn" data-export id="exchange-request-url">request URL</dfn>, a <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url" id="ref-for-concept-url">URL</a>.</p>
    <li data-md>
     <p><dfn class="dfn-paneled" data-dfn-for="exchange" data-dfn-type="dfn" data-export id="exchange-response">response</dfn>, a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response①">response</a>.</p>
   </ul>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="3.2" data-lt="Read buffer" data-noexport id="read-buffer"><span class="secno">3.2. </span><span class="content">Read buffer</span></h3>
   <p>A read buffer is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#struct" id="ref-for-struct①">struct</a> with the following items:</p>
   <ul>
    <li data-md>
     <p><dfn class="dfn-paneled" data-dfn-for="read buffer" data-dfn-type="dfn" data-noexport id="read-buffer-stream">stream</dfn>: A <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#rs-class" id="ref-for-rs-class">ReadableStream</a></code>.</p>
    <li data-md>
     <p><dfn class="dfn-paneled" data-dfn-for="read buffer" data-dfn-type="dfn" data-noexport id="read-buffer-reader">reader</dfn>: A <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#default-reader-class" id="ref-for-default-reader-class">ReadableStreamDefaultReader</a></code> whose stream is <a data-link-type="dfn" href="#read-buffer-stream" id="ref-for-read-buffer-stream">stream</a>.</p>
    <li data-md>
     <p><dfn class="dfn-paneled" data-dfn-for="read buffer" data-dfn-type="dfn" data-noexport id="read-buffer-bytes">bytes</dfn>: A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence">byte sequence</a> holding the bytes that have been read
from <a data-link-type="dfn" href="#read-buffer-stream" id="ref-for-read-buffer-stream①">stream</a> but not returned to a calling algorithm yet.</p>
   </ul>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="3.3" data-lt="Augmented Certificate" data-noexport id="augmented-certificate"><span class="secno">3.3. </span><span class="content">Augmented Certificate</span></h3>
   <p>An augmented certificate is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple">tuple</a> with the following items:</p>
   <ol>
    <li data-md>
     <p><dfn class="dfn-paneled" data-dfn-for="augmented certificate" data-dfn-type="dfn" data-noexport id="augmented-certificate-certificate">certificate</dfn>, a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①">byte sequence</a> that’s expected to hold a
DER-encoded X.509v3 certificate (<a data-link-type="biblio" href="#biblio-rfc5280">[RFC5280]</a>).</p>
    <li data-md>
     <p><dfn class="dfn-paneled" data-dfn-for="augmented certificate" data-dfn-type="dfn" data-noexport id="augmented-certificate-ocsp-response">OCSP response</dfn>, a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence②">byte sequence</a> that’s expected to hold a
DER-encoded <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6960#section-4.2.1" id="ref-for-section-4.2.1">OCSPResponse</a> for the <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate">certificate</a>.</p>
    <li data-md>
     <p><dfn class="dfn-paneled" data-dfn-for="augmented certificate" data-dfn-type="dfn" data-noexport id="augmented-certificate-sct">SCT</dfn>, a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence③">byte sequence</a> that’s expected to hold a <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6962#section-3.3" id="ref-for-section-3.3">SignedCertificateTimestampList</a> for the <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate①">certificate</a>.</p>
   </ol>
   <p>These fields are <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence④">byte sequences</a> instead of parsed and validated structures
because we expect some UAs to pass them to other systems for validation, and
some of those systems expect plain byte sequences.</p>
   <p>A <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate②">certificate</a> contains a <dfn class="dfn-paneled" data-dfn-for="certificate" data-dfn-type="dfn" data-lt="public key" data-noexport id="certificate-public-key">public
key</dfn> (<a data-link-type="dfn" href="https://tools.ietf.org/html/rfc5280#section-4.1.2.7" id="ref-for-section-4.1.2.7">Subject Public Key Info</a>), which has an <dfn class="dfn-paneled" data-dfn-for="public
key" data-dfn-type="dfn" data-noexport id="public-key-algorithm">algorithm</dfn> (<a data-link-type="dfn" href="https://tools.ietf.org/html/rfc5280#section-4.1.1.2" id="ref-for-section-4.1.1.2">AlgorithmIdentifier</a>).</p>
   <p>A <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate③">certificate</a> contains an <dfn class="dfn-paneled" data-dfn-for="certificate" data-dfn-type="dfn" data-noexport id="certificate-extensions">extensions</dfn> map (<a data-link-type="dfn" href="https://tools.ietf.org/html/rfc5280#section-4.2" id="ref-for-section-4.2">Certificate Extensions</a>) from OIDs to <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence⑤">byte sequences</a>.</p>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="certificate-chain">certificate chain</dfn> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a> of <a data-link-type="dfn" href="#augmented-certificate" id="ref-for-augmented-certificate">augmented certificates</a>, of
which the first <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item">item</a> is the <dfn class="dfn-paneled" data-dfn-for="certificate chain" data-dfn-type="dfn" data-noexport id="certificate-chain-leaf">leaf</dfn>.</p>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export data-level="3.4" data-lt="Signed Exchange report" id="signed-exchange-report"><span class="secno">3.4. </span><span class="content">Signed Exchange report</span></h3>
   <p>A signed exchange report is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#struct" id="ref-for-struct②">struct</a> with the following items:</p>
   <dl>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-result">result</dfn>
    <dd data-md>
     <p>The result string of loading signed exchange. This must be unset or one of
"<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-ok"><code>ok</code></dfn>", "<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-mi_error"><code>mi_error</code></dfn>",
"<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-non_secure_distributor"><code>non_secure_distributor</code></dfn>", "<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-parse_error"><code>parse_error</code></dfn>",
"<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-invalid_integrity_header"><code>invalid_integrity_header</code></dfn>",
"<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-signature_verification_error"><code>signature_verification_error</code></dfn>",
"<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-cert_verification_error"><code>cert_verification_error</code></dfn>", "<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-cert_fetch_error"><code>cert_fetch_error</code></dfn>",
"<dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-cert_parse_error"><code>cert_parse_error</code></dfn>",</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-outer-request">outer request</dfn>
    <dd data-md>
     <p>The <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request①">request</a> which the user agent sent to the server to load the signed exchange.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-outer-response">outer response</dfn>
    <dd data-md>
     <p>The <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response②">response</a> which the user agent received from the server.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-inner-url">inner URL</dfn>
    <dd data-md>
     <p>The logical <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url" id="ref-for-concept-url①">URL</a> of the signed exchange, if available. Otherwise, an empty
string.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-cert-url-list">cert URL list</dfn>
    <dd data-md>
     <p>The list of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url" id="ref-for-concept-url②">URLs</a> in "<code>cert-url</code>" parameters for the signed exchange’s
signatures, if available. Otherwise, an empty list.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-server-ip">server IP</dfn>
    <dd data-md>
     <p>The IP address of the server from which the user agent received the signed
exchange, if available. Otherwise, an empty string.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="signed exchange report" data-dfn-type="dfn" data-noexport id="signed-exchange-report-cert-server-ip-list">cert server IP list</dfn>
    <dd data-md>
     <p>The list of IP addresses of the servers from which the user agent received
the certificates listed in <a data-link-type="dfn" href="#signed-exchange-report-cert-url-list" id="ref-for-signed-exchange-report-cert-url-list">cert URL list</a>.</p>
   </dl>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export data-level="3.5" data-lt="Exchange Signature" id="exchange-signature"><span class="secno">3.5. </span><span class="content">Exchange Signature</span></h3>
   <p>An exchange signature is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#struct" id="ref-for-struct③">struct</a> with the following items:</p>
   <dl>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-noexport id="exchange-signature-signature">signature</dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence⑥">byte sequence</a> holding a signature of the exchange.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-noexport id="exchange-signature-certificate-chain">certificate chain</dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#certificate-chain" id="ref-for-certificate-chain">certificate chain</a> whose <a data-link-type="dfn" href="#certificate-chain-leaf" id="ref-for-certificate-chain-leaf">leaf</a>'s <a data-link-type="dfn" href="#certificate-public-key" id="ref-for-certificate-public-key">public key</a> can verify the <a data-link-type="dfn" href="#exchange-signature-signature" id="ref-for-exchange-signature-signature">signature</a> and from which the UA will try to build a path from the <a data-link-type="dfn" href="#certificate-chain-leaf" id="ref-for-certificate-chain-leaf①">leaf</a> to a trusted root.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-noexport id="exchange-signature-certsha256">certSha256</dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence⑦">byte sequence</a> holding the <a data-link-type="dfn" href="http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#" id="termref-for-">SHA-256</a> hash that verified the <a data-link-type="dfn" href="#exchange-signature-certificate-chain" id="ref-for-exchange-signature-certificate-chain">certificate chain</a>'s <a data-link-type="dfn" href="#certificate-chain-leaf" id="ref-for-certificate-chain-leaf②">leaf</a>.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-noexport id="exchange-signature-integrity-header">integrity header</dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①">list</a> of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string">ASCII strings</a> that describes the response header and any of
its parameters that guard the integrity of the response payload.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-noexport id="exchange-signature-validityurl">validityUrl</dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url" id="ref-for-concept-url③">URL</a> describing where to update this signature.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-noexport id="exchange-signature-validityurlbytes">validityUrlBytes</dfn>
    <dd data-md>
     <p>The bytes that <a data-link-type="dfn" href="#exchange-signature-validityurl" id="ref-for-exchange-signature-validityurl">validityUrl</a> was parsed from.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-noexport id="exchange-signature-date">date</dfn>
    <dd data-md>
     <p>The POSIX time at which the signature starts being valid.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-noexport id="exchange-signature-expiration-time">expiration time</dfn>
    <dd data-md>
     <p>The POSIX time at which the signature stops being valid.</p>
   </dl>
   <h2 class="heading settled" data-level="4" id="algorithms"><span class="secno">4. </span><span class="content">Algorithms</span><a class="self-link" href="#algorithms"></a></h2>
   <h3 class="heading settled algorithm" data-algorithm="Identifying signed exchanges" data-level="4.1" id="identifying-sxg"><span class="secno">4.1. </span><span class="content">Identifying signed exchanges</span><a class="self-link" href="#identifying-sxg"></a></h3>
   <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="signed-exchange-version">signed exchange version</dfn> of a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response③">response</a> <var>response</var> is the
result of the following steps:</p>
   <ol>
    <li data-md>
     <p>If <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#determine-nosniff" id="ref-for-determine-nosniff">determine nosniff</a> on <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list①">header
list</a> returns false, return undefined.</p>
     <p class="note" role="note"><span>Note:</span> This requires servers to include the <code>X-Content-Type-Options: nosniff</code> header when they serve signed exchanges, which prevents some clients that
don’t understand signed exchanges from interpreting one as another content
type.</p>
    <li data-md>
     <p>Let <var>mimeType</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-extract-mime-type" id="ref-for-concept-header-extract-mime-type">extracting a MIME type</a> from <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list②">header list</a>.</p>
    <li data-md>
     <p>If <var>mimeType</var> is a failure, return undefined.</p>
    <li data-md>
     <p>If <var>mimeType</var>’s <a data-link-type="dfn" href="https://mimesniff.spec.whatwg.org/#mime-type-essence" id="ref-for-mime-type-essence">essence</a> is not <code>"application/signed-exchange"</code>,
return undefined.</p>
    <li data-md>
     <p>Let <var>params</var> be <var>mimeType</var>’s <a data-link-type="dfn" href="https://mimesniff.spec.whatwg.org/#parameters" id="ref-for-parameters">parameters</a></p>
    <li data-md>
     <p>If <var>params</var>["v"] exists, return it. Otherwise, return undefined.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Extracting the fallback URL" data-level="4.2" id="parsing-fallback"><span class="secno">4.2. </span><span class="content">Extracting the fallback URL</span><a class="self-link" href="#parsing-fallback"></a></h3>
   <p>This section defines how to load a the fallback URL from its invariant location
in an unrecognized signed exchange version.</p>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="extracting-the-fallback-url">Extracting the fallback URL</dfn> from a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response④">response</a> <var>response</var> returns
the result of the following steps:</p>
   <ol>
    <li data-md>
     <p class="assertion">Assert: This algorithm is running <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①">in parallel</a>.</p>
    <li data-md>
     <p class="assertion">Assert: The <a data-link-type="dfn" href="#signed-exchange-version" id="ref-for-signed-exchange-version①">signed exchange version</a> of <var>response</var> is not undefined.</p>
    <li data-md>
     <p>Let <var>bodyStream</var> be <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream">stream</a>.</p>
    <li data-md>
     <p>If <var>bodyStream</var> is null, return failure.</p>
    <li data-md>
     <p>Let <var>stream</var> be a <a data-link-type="dfn" href="#new-read-buffer" id="ref-for-new-read-buffer">new read buffer</a> for <var>bodyStream</var>.</p>
    <li data-md>
     <p>Let (<var>magic</var>, <var>fallbackUrlBytes</var>, <var>fallbackUrl</var>) be the result of <a data-link-type="dfn" href="#parsing-the-invariant-prefix" id="ref-for-parsing-the-invariant-prefix">parsing the invariant prefix</a> from <var>stream</var>. If returns a failure, return that failure.</p>
    <li data-md>
     <p>Return <var>fallbackUrlBytes</var>.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Parsing signed exchanges" data-level="4.3" id="parsing"><span class="secno">4.3. </span><span class="content">Parsing signed exchanges</span><a class="self-link" href="#parsing"></a></h3>
   <p>This section defines how to load the formats defined in <a data-link-type="biblio" href="#biblio-draft-yasskin-httpbis-origin-signed-exchanges-impl-02">[draft-yasskin-httpbis-origin-signed-exchanges-impl-02]</a> and <a data-link-type="biblio" href="#biblio-draft-yasskin-httpbis-origin-signed-exchanges-impl-03">[draft-yasskin-httpbis-origin-signed-exchanges-impl-03]</a>.</p>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-a-signed-exchange">Parsing a signed exchange</dfn> of version <var>version</var> from a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response⑤">response</a> <var>response</var> in the context of an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object">environment settings object</a> <var>client</var>,
reporting to a <a data-link-type="dfn" href="#signed-exchange-report" id="ref-for-signed-exchange-report">signed exchange report</a> <var>report</var>, returns an <a data-link-type="dfn" href="#exchange" id="ref-for-exchange②">exchange</a> or a
string which indicates a <a data-link-type="dfn" href="#signed-exchange-report-result" id="ref-for-signed-exchange-report-result">result</a> as described by the
following steps</p>
   <ol>
    <li data-md>
     <p class="assertion">Assert: This algorithm is running <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②">in parallel</a>.</p>
    <li data-md>
     <p class="assertion">Assert: The <a data-link-type="dfn" href="#signed-exchange-version" id="ref-for-signed-exchange-version②">signed exchange version</a> of <var>response</var> is, if <var>version</var> is</p>
     <dl class="switch">
      <dt data-md><code>b2</code>
      <dd data-md>
       <p><code>"b2"</code></p>
      <dt data-md><code>b3</code>
      <dd data-md>
       <p><code>"b3"</code></p>
     </dl>
    <li data-md>
     <p>If <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-url" id="ref-for-concept-response-url">URL</a>'s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin">origin</a> is not a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-origin" id="ref-for-potentially-trustworthy-origin">potentially
trustworthy origin</a>, return
"<a data-link-type="dfn" href="#signed-exchange-report-non_secure_distributor" id="ref-for-signed-exchange-report-non_secure_distributor">non_secure_distributor</a>".</p>
     <p class="note" role="note"><span>Note:</span> This ensures that the privacy properties of retrieving an HTTPS
resource via a signed exchange are no worse than retrieving it via TLS.</p>
    <li data-md>
     <p>Let <var>bodyStream</var> be <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body①">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream①">stream</a>.</p>
    <li data-md>
     <p>If <var>bodyStream</var> is null, return "<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error">parse_error</a>".</p>
    <li data-md>
     <p>Let <var>stream</var> be a <a data-link-type="dfn" href="#new-read-buffer" id="ref-for-new-read-buffer①">new read buffer</a> for <var>bodyStream</var>.</p>
    <li data-md>
     <p>Let (<var>magic</var>, <var>requestUrlBytes</var>, <var>requestUrl</var>) be the result of <a data-link-type="dfn" href="#parsing-the-invariant-prefix" id="ref-for-parsing-the-invariant-prefix①">parsing the
invariant prefix</a> from <var>stream</var>. If returns a failure, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error①">parse_error</a>".</p>
    <li data-md>
     <p>Set <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-inner-url" id="ref-for-signed-exchange-report-inner-url">inner URL</a> to <var>requestUrl</var>.</p>
    <li data-md>
     <p>If <var>magic</var> is not the following value, depending on <var>version</var>, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error②">parse_error</a>":</p>
     <dl class="switch">
      <dt data-md><code>b2</code>
      <dd data-md>
       <p><code>`sxg1-b2\0`</code></p>
      <dt data-md><code>b3</code>
      <dd data-md>
       <p><code>`sxg1-b3\0`</code></p>
     </dl>
    <li data-md>
     <p class="assertion">Assert: <var>requestUrlBytes</var> should match the result of <a data-link-type="dfn" href="#extracting-the-fallback-url" id="ref-for-extracting-the-fallback-url①">extracting the
fallback URL</a> from <var>response</var>.</p>
    <li data-md>
     <p>Let <var>encodedSigLength</var> be the result of <a data-link-type="dfn" href="#read-buffer-read" id="ref-for-read-buffer-read">reading</a> 3 bytes from <var>stream</var>.</p>
    <li data-md>
     <p>Let <var>encodedHeaderLength</var> be the result of <a data-link-type="dfn" href="#read-buffer-read" id="ref-for-read-buffer-read①">reading</a> 3 bytes
from <var>stream</var>.</p>
    <li data-md>
     <p>If <var>encodedSigLength</var> or <var>encodedHeaderLength</var> is a failure, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error③">parse_error</a>".</p>
    <li data-md>
     <p>Let <var>sigLength</var> be the result of decoding <var>encodedSigLength</var> as a big-endian
integer.</p>
    <li data-md>
     <p>Let <var>headerLength</var> be the result of decoding <var>encodedHeaderLength</var> as a
big-endian integer.</p>
    <li data-md>
     <p>If <var>sigLength</var> > 16384 or <var>headerLength</var> > 524288, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error④">parse_error</a>".</p>
    <li data-md>
     <p>Let <var>signature</var> be the result of <a data-link-type="dfn" href="#read-buffer-read" id="ref-for-read-buffer-read②">reading</a> <var>sigLength</var> bytes
from <var>stream</var>.</p>
    <li data-md>
     <p>If <var>signature</var> is a failure, return "<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error⑤">parse_error</a>".</p>
    <li data-md>
     <p>Let <var>parsedSignature</var> be the result of <a data-link-type="dfn" href="#parsing-the-signature-header-field" id="ref-for-parsing-the-signature-header-field">parsing the Signature header field</a> <var>signature</var> in the context of <var>client</var> reporting to with <var>report</var>.</p>
    <li data-md>
     <p>If <var>parsedSignature</var> is not an <a data-link-type="dfn" href="#exchange-signature" id="ref-for-exchange-signature">exchange signature</a>, return it.</p>
    <li data-md>
     <p>Let <var>headerBytes</var> be the result of <a data-link-type="dfn" href="#read-buffer-read" id="ref-for-read-buffer-read③">reading</a> <var>headerLength</var> bytes from <var>stream</var>.</p>
    <li data-md>
     <p>If <var>headerBytes</var> is a failure, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error⑥">parse_error</a>".</p>
    <li data-md>
     <p>If <var>parsedSignature</var> <a data-link-type="dfn" href="#exchange-signature-is-valid" id="ref-for-exchange-signature-is-valid">is not valid</a> for <var>headerBytes</var> and <var>requestUrlBytes</var>, and signed exchange version <var>version</var>, return
"<a data-link-type="dfn" href="#signed-exchange-report-signature_verification_error" id="ref-for-signed-exchange-report-signature_verification_error">signature_verification_error</a>".</p>
    <li data-md>
     <p>Let <var>parsedExchange</var> be, if <var>version</var> is:</p>
     <dl class="switch">
      <dt data-md><code>b2</code>
      <dd data-md>
       <p>the result of <a data-link-type="dfn" href="#parsing-b2-cbor-headers" id="ref-for-parsing-b2-cbor-headers">parsing b2 CBOR headers</a> given <var>headerBytes</var> and <var>requestUrl</var>.</p>
      <dt data-md><code>b3</code>
      <dd data-md>
       <p>the result of <a data-link-type="dfn" href="#parsing-b3-cbor-headers" id="ref-for-parsing-b3-cbor-headers">parsing b3 CBOR headers</a> given <var>headerBytes</var> and <var>requestUrl</var>.</p>
     </dl>
    <li data-md>
     <p>If <var>parsedSignature</var> <a data-link-type="dfn" href="#exchange-signature-establishes-cross-origin-trust" id="ref-for-exchange-signature-establishes-cross-origin-trust">does not establish cross-origin
trust</a> for <var>parsedExchange</var>, return
"<a data-link-type="dfn" href="#signed-exchange-report-cert_verification_error" id="ref-for-signed-exchange-report-cert_verification_error">cert_verification_error</a>".</p>
    <li data-md>
     <p>Set <var>parsedExchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response④">response</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-https-state" id="ref-for-concept-response-https-state">HTTPS state</a> to
either "<code>deprecated</code>" or "<code>modern</code>".</p>
     <p class="note" role="note"><span>Note:</span> See <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-http-network-fetch" id="ref-for-concept-http-network-fetch">HTTP-network fetch</a> for details of this choice.</p>
    <li data-md>
     <p>If <var>parsedExchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response⑤">response</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status①">status</a> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#redirect-status" id="ref-for-redirect-status①">redirect status</a> or the <a data-link-type="dfn" href="#signed-exchange-version" id="ref-for-signed-exchange-version③">signed exchange version</a> of <var>parsedExchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response⑥">response</a> is not undefined, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error⑦">parse_error</a>".</p>
     <p class="note" role="note"><span>Note:</span> This might simplify the UA’s implementation, since it doesn’t have to
handle nested signed exchanges.</p>
    <li data-md>
     <p><a data-link-type="dfn" href="#reading-a-body" id="ref-for-reading-a-body">Read a body</a> from <var>stream</var> into <var>parsedExchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response⑦">response</a> using <var>parsedSignature</var> to check its integrity. If
this returns an error string, return it.</p>
     <p class="note" role="note"><span>Note:</span> Typically this body’s stream is still being enqueued to after
returning.</p>
    <li data-md>
     <p>Return <var>parsedExchange</var>.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Parsing the invariant prefix" data-level="4.4" id="parsing-prefix"><span class="secno">4.4. </span><span class="content">Parsing the invariant prefix</span><a class="self-link" href="#parsing-prefix"></a></h3>
   <p>All signed exchange versions start with the same initial bytes, parsed by this
section.</p>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-the-invariant-prefix">Parsing the invariant prefix</dfn> from a <a data-link-type="dfn" href="#read-buffer" id="ref-for-read-buffer">read buffer</a> <var>stream</var> returns
a failure or the triple of a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence⑧">byte sequence</a> <var>magic</var>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence⑨">byte sequence</a> <var>fallbackUrlBytes</var>, and <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url" id="ref-for-concept-url④">URL</a> <var>fallbackUrl</var>, as described by the following
steps:</p>
   <ol>
    <li data-md>
     <p class="assertion">Assert: This algorithm is running <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③">in parallel</a>.</p>
    <li data-md>
     <p>Let <var>magic</var> be the result of <a data-link-type="dfn" href="#read-buffer-read" id="ref-for-read-buffer-read④">reading</a> 8 bytes from <var>stream</var>.</p>
    <li data-md>
     <p>If <var>magic</var> is a failure, return it.</p>
    <li data-md>
     <p>Let <var>encodedFallbackUrlLength</var> be the result of <a data-link-type="dfn" href="#read-buffer-read" id="ref-for-read-buffer-read⑤">reading</a> 2
bytes from <var>stream</var>.</p>
    <li data-md>
     <p>If <var>encodedFallbackUrlLength</var> is a failure, return it.</p>
    <li data-md>
     <p>Let <var>fallbackUrlLength</var> be the result of decoding <var>encodedFallbackUrlLength</var> as a big-endian integer.</p>
    <li data-md>
     <p>Let <var>fallbackUrlBytes</var> be the result of <a data-link-type="dfn" href="#read-buffer-read" id="ref-for-read-buffer-read⑥">reading</a> <var>fallbackUrlLength</var> bytes from <var>stream</var>.</p>
    <li data-md>
     <p>If <var>fallbackUrlBytes</var> is a failure, return it.</p>
    <li data-md>
     <p>Let <var>fallbackUrlString</var> be the result of <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail" id="ref-for-utf-8-decode-without-bom-or-fail">UTF-8 decode without BOM or fail</a> on <var>fallbackUrlBytes</var>.</p>
    <li data-md>
     <p>If <var>fallbackUrlString</var> is a failure, return it.</p>
    <li data-md>
     <p>Let <var>fallbackUrl</var> be the result of running the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser">URL parser</a> on <var>fallbackUrlString</var>.</p>
    <li data-md>
     <p>If <var>fallbackUrl</var> is a failure, if it has a non-null <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-fragment" id="ref-for-concept-url-fragment">fragment</a>, or if
its <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme">scheme</a> is something other than <code>"https"</code>, return a failure.</p>
    <li data-md>
     <p>Return (<var>magic</var>, <var>fallbackUrlBytes</var>, <var>fallbackUrl</var>).</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Parsing a Signature Header Field" data-level="4.5" id="parsing-signature"><span class="secno">4.5. </span><span class="content">Parsing a Signature Header Field</span><a class="self-link" href="#parsing-signature"></a></h3>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-the-signature-header-field">Parsing the Signature header field</dfn> <var>signatureString</var> in the context
of an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①">environment settings object</a> <var>client</var>, reporting to a <a data-link-type="dfn" href="#signed-exchange-report" id="ref-for-signed-exchange-report①">signed exchange report</a> <var>report</var>, returns an <a data-link-type="dfn" href="#exchange-signature" id="ref-for-exchange-signature①">exchange signature</a> or
a string which indicates a <a data-link-type="dfn" href="#signed-exchange-report-result" id="ref-for-signed-exchange-report-result①">result</a>, as described by
the following steps:</p>
   <ol>
    <li data-md>
     <p class="assertion">Assert: This algorithm is running <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel④">in parallel</a>.</p>
    <li data-md>
     <p>If <var>signatureString</var> contains any bytes that aren’t <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-byte" id="ref-for-ascii-byte">ASCII bytes</a>, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error⑧">parse_error</a>".</p>
    <li data-md>
     <p>Let <var>parsed</var> be the result of <a data-link-type="dfn" href="https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2" id="ref-for-section-4.2①">Parsing HTTP1 Header Fields into Structured
Headers</a> given an <var>input_string</var> of the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-decode" id="ref-for-ascii-decode">ASCII decoding</a> of <var>signatureString</var> and a <var>header_type</var> of "param-list".</p>
    <li data-md>
     <p>If <var>parsed</var> has more than one element, "<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error⑨">parse_error</a>".</p>
     <p class="note" role="note"><span>Note:</span> This limitation of current implementations will go away in the future.</p>
    <li data-md>
     <p>If any of the parameters of <var>parsed</var>[0] listed here doesn’t have the
associated type, "<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error①⓪">parse_error</a>".</p>
     <dl>
      <dt data-md>Byte sequence
      <dd data-md>
       <p>"sig", "cert-sha256"</p>
      <dt data-md>String
      <dd data-md>
       <p>"integrity", "cert-url", "validity-url"</p>
      <dt data-md>Integer
      <dd data-md>
       <p>"date", "expires"</p>
     </dl>
    <li data-md>
     <p>Let <var>result</var> be a new <a data-link-type="dfn" href="#exchange-signature" id="ref-for-exchange-signature②">exchange signature</a> struct.</p>
    <li data-md>
     <p>Set <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-signature" id="ref-for-exchange-signature-signature①">signature</a> to the "sig" parameter of <var>parsed</var>[0].</p>
    <li data-md>
     <p>Set <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-integrity-header" id="ref-for-exchange-signature-integrity-header">integrity header</a> to the result of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#strictly-split" id="ref-for-strictly-split">strictly splitting</a> the "integrity" parameter of <var>parsed</var>[0] on U+002F
(<code>/</code>).</p>
    <li data-md>
     <p>Let <var>certUrl</var> be the result of running the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser①">URL parser</a> on the "cert-url"
parameter of <var>parsed</var>[0].</p>
    <li data-md>
     <p>Append <var>certUrl</var> to <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-cert-url-list" id="ref-for-signed-exchange-report-cert-url-list①">cert URL list</a>.</p>
    <li data-md>
     <p>If <var>certUrl</var> is a failure, if it has a non-null <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-fragment" id="ref-for-concept-url-fragment①">fragment</a>, or if its <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme①">scheme</a> is something other than <code>"https"</code> or <code>"data"</code>, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error①①">parse_error</a>".</p>
    <li data-md>
     <p>Set <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-certsha256" id="ref-for-exchange-signature-certsha256">certSha256</a> to the "cert-sha256"
parameter of <var>parsed</var>[0].</p>
    <li data-md>
     <p>Set <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-validityurlbytes" id="ref-for-exchange-signature-validityurlbytes">validityUrlBytes</a> to the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-encode" id="ref-for-ascii-encode①">ASCII
encoding</a> of the "validity-url" parameter of <var>parsed</var>[0].</p>
    <li data-md>
     <p>Let <var>validityUrl</var> be the result of running the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser②">URL parser</a> on the
"validity-url" parameter of <var>parsed</var>[0]..</p>
    <li data-md>
     <p>If <var>validityUrl</var> is a failure, if it has a non-null <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-fragment" id="ref-for-concept-url-fragment②">fragment</a>, or if
its <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme②">scheme</a> is something other than <code>"https"</code>, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error①②">parse_error</a>".</p>
    <li data-md>
     <p>Set <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-validityurl" id="ref-for-exchange-signature-validityurl①">validityUrl</a> to <var>validityUrl</var>.</p>
    <li data-md>
     <p>Set <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-date" id="ref-for-exchange-signature-date">date</a> to the "date" parameter of <var>parsed</var>[0].</p>
    <li data-md>
     <p>Set <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-expiration-time" id="ref-for-exchange-signature-expiration-time①">expiration time</a> to the "expires"
parameter of <var>parsed</var>[0].</p>
    <li data-md>
     <p>If <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-expiration-time" id="ref-for-exchange-signature-expiration-time②">expiration time</a> or <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-date" id="ref-for-exchange-signature-date①">date</a> is less than 0 or greater than 2<sup>63</sup>-1, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error①③">parse_error</a>".</p>
    <li data-md>
     <p>If <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-expiration-time" id="ref-for-exchange-signature-expiration-time③">expiration time</a> &lt;= <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-date" id="ref-for-exchange-signature-date②">date</a>, return
"<a data-link-type="dfn" href="#signed-exchange-report-parse_error" id="ref-for-signed-exchange-report-parse_error①④">parse_error</a>".</p>
    <li data-md>
     <p>Set <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-certificate-chain" id="ref-for-exchange-signature-certificate-chain①">certificate chain</a> to the result of <a data-link-type="dfn" href="#handling-the-certificate-reference" id="ref-for-handling-the-certificate-reference">handling the certificate reference</a> <var>certUrl</var> with a hash of <var>result</var>’s <a data-link-type="dfn" href="#exchange-signature-certsha256" id="ref-for-exchange-signature-certsha256①">certSha256</a> and <var>report</var> in the context of <var>client</var>.
If this is not a <a data-link-type="dfn" href="#certificate-chain" id="ref-for-certificate-chain①">certificate chain</a>, return it.</p>
    <li data-md>
     <p>Return <var>result</var>.</p>
   </ol>
   <h4 class="heading settled algorithm" data-algorithm="Handling the certificate reference" data-level="4.5.1" id="handling-cert-url"><span class="secno">4.5.1. </span><span class="content">Handling the certificate reference</span><a class="self-link" href="#handling-cert-url"></a></h4>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="handling-the-certificate-reference">Handling the certificate reference</dfn> <var>certUrl</var> with the SHA-256 hash <var>certSha256</var> in the context of an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object②">environment settings object</a> <var>client</var>,
reporting to a <a data-link-type="dfn" href="#signed-exchange-report" id="ref-for-signed-exchange-report②">signed exchange report</a> <var>report</var>, returns a <a data-link-type="dfn" href="#certificate-chain" id="ref-for-certificate-chain②">certificate chain</a> or a string which indicates a <a data-link-type="dfn" href="#signed-exchange-report-result" id="ref-for-signed-exchange-report-result②">result</a>, as described by the following steps:</p>
   <ol>
    <li data-md>
     <p class="assertion">Assert: This algorithm is running <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑤">in parallel</a>.</p>
    <li data-md>
     <p>Let <var>certRequest</var> be a new <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request②">request</a> with the following items:</p>
     <dl>
      <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url">url</a>
      <dd data-md>
       <p><var>certUrl</var></p>
      <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-header-list" id="ref-for-concept-request-header-list">header list</a>
      <dd data-md>
       <p>«<code>`Accept`</code>: <code>`application/cert-chain+cbor`</code>»</p>
      <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client" id="ref-for-concept-request-client①">client</a>
      <dd data-md>
       <p><var>client</var></p>
      <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#request-service-workers-mode" id="ref-for-request-service-workers-mode">service-workers mode</a>
      <dd data-md>
       <p>"<code>none</code>"</p>
      <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-mode" id="ref-for-concept-request-mode">mode</a>
      <dd data-md>
       <p>"<code>cors</code>"</p>
     </dl>
    <li data-md>
     <p>Let <var>certResponse</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch">fetching</a> <var>certRequest</var>.</p>
    <li data-md>
     <p>Append the IP address of the server from which the user agent received the <var>certResponse</var> to <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-cert-server-ip-list" id="ref-for-signed-exchange-report-cert-server-ip-list">cert server IP list</a>,
if available.</p>
    <li data-md>
     <p>If <var>certResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status②">status</a> is not <code>200</code>, return
"<a data-link-type="dfn" href="#signed-exchange-report-cert_fetch_error" id="ref-for-signed-exchange-report-cert_fetch_error">cert_fetch_error</a>".</p>
    <li data-md>
     <p>Let <var>certMimeType</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-extract-mime-type" id="ref-for-concept-header-extract-mime-type①">extracting a MIME type</a> from <var>certResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list③">header list</a>.</p>
    <li data-md>
     <p>If <var>certMimeType</var> is a failure or its <a data-link-type="dfn" href="https://mimesniff.spec.whatwg.org/#mime-type-essence" id="ref-for-mime-type-essence①">essence</a> is not <code>"application/cert-chain+cbor"</code>, return
"<a data-link-type="dfn" href="#signed-exchange-report-cert_fetch_error" id="ref-for-signed-exchange-report-cert_fetch_error①">cert_fetch_error</a>".</p>
    <li data-md>
     <p>If <var>certResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body②">body</a> is null or that body’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream②">stream</a> is null, return "<a data-link-type="dfn" href="#signed-exchange-report-cert_parse_error" id="ref-for-signed-exchange-report-cert_parse_error">cert_parse_error</a>".</p>
    <li data-md>
     <p>Let <var>bytes</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream" id="ref-for-concept-read-all-bytes-from-readablestream">reading all
bytes</a> from <var>certResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body③">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream③">stream</a> with a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-get-reader" id="ref-for-concept-get-reader">new reader</a> over the same stream.</p>
    <li data-md>
     <p>Wait for <var>bytes</var> to settle.</p>
    <li data-md>
     <p>If <var>bytes</var> was rejected, return "<a data-link-type="dfn" href="#signed-exchange-report-cert_parse_error" id="ref-for-signed-exchange-report-cert_parse_error①">cert_parse_error</a>".</p>
    <li data-md>
     <p>Let <var>chain</var> be the <a data-link-type="dfn" href="#certificate-chain" id="ref-for-certificate-chain③">certificate chain</a> produced by parsing <var>bytes</var>’ value
using the <a data-link-type="dfn" href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-3.3" id="ref-for-section-3.3①">cert-chain CDDL</a>. If <var>bytes</var>’s value doesn’t match this CDDL or
isn’t <a data-link-type="dfn" href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-3.4" id="ref-for-section-3.4">canonically-encoded CBOR</a>, return
 "<a data-link-type="dfn" href="#signed-exchange-report-cert_parse_error" id="ref-for-signed-exchange-report-cert_parse_error②">cert_parse_error</a>".</p>
    <li data-md>
     <p class="assertion">Assert: <var>chain</var> has at least one <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item①">item</a>.</p>
    <li data-md>
     <p>If the <a data-link-type="dfn" href="http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#" id="termref-for-①">SHA-256</a> hash of <var>chain</var>’s <a data-link-type="dfn" href="#certificate-chain-leaf" id="ref-for-certificate-chain-leaf③">leaf</a>'s <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate④">certificate</a> is not equal to <var>certSha256</var>, return
 "<a data-link-type="dfn" href="#signed-exchange-report-signature_verification_error" id="ref-for-signed-exchange-report-signature_verification_error①">signature_verification_error</a>".</p>
    <li data-md>
     <p>Return <var>chain</var>.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="The signed message" data-level="4.6" id="the-signed-message"><span class="secno">4.6. </span><span class="content">The signed message</span><a class="self-link" href="#the-signed-message"></a></h3>
   <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="signed-message">signed message</dfn> for a version <var>version</var>, an <a data-link-type="dfn" href="#exchange-signature" id="ref-for-exchange-signature③">exchange signature</a> <var>signature</var> and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①⓪">byte sequences</a> <var>requestUrlBytes</var> and <var>headerBytes</var> is the
concatenation of the following <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①①">byte sequences</a>:</p>
   <ol>
    <li data-md>
     <p>The byte 0x20 (SP) repeated 64 times. This matches the TLS 1.3 (<a data-link-type="biblio" href="#biblio-rfc8446">[RFC8446]</a>)
format to avoid cross- protocol attacks if anyone uses the same key in a TLS
certificate and an exchange-signing certificate.</p>
    <li data-md>
     <p>A context string consisting of, if <var>version</var> is:</p>
     <dl class="switch">
      <dt data-md><code>b2</code>
      <dd data-md>
       <p><code>`HTTP Exchange 1 b2`</code></p>
      <dt data-md><code>b3</code>
      <dd data-md>
       <p><code>`HTTP Exchange 1 b3`</code></p>
     </dl>
     <p class="note" role="note"><span>Note:</span> Each draft of <a data-link-type="biblio" href="#biblio-draft-yasskin-httpbis-origin-signed-exchanges-impl-02">[draft-yasskin-httpbis-origin-signed-exchanges-impl-02]</a> and the final RFC
for <a data-link-type="biblio" href="#biblio-draft-yasskin-http-origin-signed-responses">[draft-yasskin-http-origin-signed-responses]</a> will use distinct context
strings.</p>
    <li data-md>
     <p>A single 0x00 byte which serves as a separator.</p>
    <li data-md>
     <p>A single 0x20 (SP) byte, representing the length of the next field.</p>
    <li data-md>
     <p><var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-certsha256" id="ref-for-exchange-signature-certsha256②">certSha256</a>.</p>
    <li data-md>
     <p>The 8-byte big-endian encoding of the length in bytes of <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-validityurlbytes" id="ref-for-exchange-signature-validityurlbytes①">validityUrlBytes</a>.</p>
    <li data-md>
     <p><var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-validityurlbytes" id="ref-for-exchange-signature-validityurlbytes②">validityUrlBytes</a>.</p>
    <li data-md>
     <p>The 8-byte big-endian encoding of <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-date" id="ref-for-exchange-signature-date③">date</a>.</p>
    <li data-md>
     <p>The 8-byte big-endian encoding of <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-expiration-time" id="ref-for-exchange-signature-expiration-time④">expiration time</a>.</p>
    <li data-md>
     <p>The 8-byte big-endian encoding of the length in bytes of <var>requestUrlBytes</var>.</p>
    <li data-md>
     <p><var>requestUrlBytes</var>.</p>
    <li data-md>
     <p>The 8-byte big-endian encoding of the length in bytes of <var>headerBytes</var>.</p>
    <li data-md>
     <p><var>headerBytes</var>.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Validating a signature" data-level="4.7" id="validating-signature"><span class="secno">4.7. </span><span class="content">Validating a signature</span><a class="self-link" href="#validating-signature"></a></h3>
   <p>An <a data-link-type="dfn" href="#exchange-signature" id="ref-for-exchange-signature④">exchange signature</a> <var>signature</var> <dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-lt="is
valid|is not valid" data-noexport id="exchange-signature-is-valid">is valid</dfn> for <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①②">byte sequences</a> <var>requestUrlBytes</var> and <var>headerBytes</var>, and signed exchange version <var>version</var>, if the following steps
return <code>valid</code>:</p>
   <ol>
    <li data-md>
     <p>Let <var>clockSkew</var> be the uncertainty in the UA’s estimate of the current time
caused by clock skew on the client. The UA MAY set this to 0 or use a more
sophisticated estimate.</p>
    <li data-md>
     <p>If the UA’s estimate of the current time is more than <var>clockSkew</var> before <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-date" id="ref-for-exchange-signature-date④">date</a>, return "untrusted".</p>
     <p class="note" role="note"><span>Note:</span> We take estimated clock skew into account when checking the
signature’s <a data-link-type="dfn" href="#exchange-signature-date" id="ref-for-exchange-signature-date⑤">date</a> because we want well-behaved servers
to use the time they created the signature, but if they immediately start
serving that signature, and skewed clients don’t try to correct for their
skew, those clients will reject the signature.</p>
     <p class="issue" id="issue-a7ea6416"><a class="self-link" href="#issue-a7ea6416"></a> Our security reviewers aren’t sure we should
allow UAs to take clock skew into account. <a href="https://github.com/WICG/webpackage/issues/141">&lt;https://github.com/WICG/webpackage/issues/141></a></p>
    <li data-md>
     <p>If the UA’s estimate of the current time is after <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-expiration-time" id="ref-for-exchange-signature-expiration-time⑤">expiration time</a>, return "untrusted".</p>
     <p class="note" role="note"><span>Note:</span> We use the client’s best guess of the current time to check the <a data-link-type="dfn" href="#exchange-signature-expiration-time" id="ref-for-exchange-signature-expiration-time⑥">expiration time</a> so that attackers trying to get an
exchange trusted for longer, are constrained to modify the client’s clock
and can’t also attack its estimate of its skew.</p>
    <li data-md>
     <p>Let <var>message</var> be the <a data-link-type="dfn" href="#signed-message" id="ref-for-signed-message">signed message</a> for <var>version</var>, <var>signature</var>, <var>requestUrlBytes</var>, and <var>headerBytes</var>.</p>
    <li data-md>
     <p>Let <var>publicKey</var> be the <a data-link-type="dfn" href="#certificate-public-key" id="ref-for-certificate-public-key①">public key</a> of <var>parsedSignature</var>’s <a data-link-type="dfn" href="#exchange-signature-certificate-chain" id="ref-for-exchange-signature-certificate-chain②">certificate chain</a>'s <a data-link-type="dfn" href="#certificate-chain-leaf" id="ref-for-certificate-chain-leaf④">leaf</a>. If
the certificate can’t be parsed enough to find this public key, return <code>invalid</code>.</p>
    <li data-md>
     <p>If <var>publicKey</var>’s <a data-link-type="dfn" href="#public-key-algorithm" id="ref-for-public-key-algorithm">algorithm</a> is not <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc5480#section-2.1.1" id="ref-for-section-2.1.1">id-ecPublicKey</a> on the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc5480#section-2.1.1.1" id="ref-for-section-2.1.1.1">secp256r1</a> named curve, return <code>invalid</code>.</p>
    <li data-md>
     <p>If <var>parsedSignature</var>’s <a data-link-type="dfn" href="#exchange-signature-signature" id="ref-for-exchange-signature-signature②">signature</a> is not a valid
signature of <var>message</var> by <var>publicKey</var> using the <a data-link-type="dfn" href="https://tools.ietf.org/html/draft-ietf-tls-tls13-28#section-4.2.3" id="ref-for-section-4.2.3">ecdsa_secp256r1_sha256</a> algorithm, return <code>invalid</code>.</p>
    <li data-md>
     <p>Return <code>valid</code>.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Cross-origin trust" data-level="4.8" id="cross-origin-trust"><span class="secno">4.8. </span><span class="content">Cross-origin trust</span><a class="self-link" href="#cross-origin-trust"></a></h3>
   <p>A <a data-link-type="dfn" href="#exchange-signature-is-valid" id="ref-for-exchange-signature-is-valid①">valid</a> <a data-link-type="dfn" href="#exchange-signature" id="ref-for-exchange-signature⑤">exchange signature</a> <var>signature</var> <dfn class="dfn-paneled" data-dfn-for="exchange signature" data-dfn-type="dfn" data-lt="establishes cross-origin trust|does not establish
cross-origin trust" data-noexport id="exchange-signature-establishes-cross-origin-trust">establishes cross-origin trust</dfn> in an <a data-link-type="dfn" href="#exchange" id="ref-for-exchange③">exchange</a> <var>exchange</var> if the following steps return "trusted":</p>
   <ol>
    <li data-md>
     <p>Let <var>requestUrl</var> be <var>exchange</var>’s <a data-link-type="dfn" href="#exchange-request-url" id="ref-for-exchange-request-url③">request URL</a>.</p>
    <li data-md>
     <p>If <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-validityurl" id="ref-for-exchange-signature-validityurl②">validityUrl</a>'s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin①">origin</a> is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin">same origin</a> with <var>requestUrl</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin②">origin</a>, return "untrusted".</p>
    <li data-md>
     <p>If <var>exchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response⑧">response</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list④">header list</a> includes an <a data-link-type="dfn" href="https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#uncached-headers" id="ref-for-uncached-headers">uncached response header</a>, return "untrusted".</p>
    <li data-md>
     <p>If <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-expiration-time" id="ref-for-exchange-signature-expiration-time⑦">expiration time</a> is more than 604800
seconds (7 days) after <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-date" id="ref-for-exchange-signature-date⑥">date</a>, return
"untrusted".</p>
    <li data-md>
     <p>If <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-certificate-chain" id="ref-for-exchange-signature-certificate-chain③">certificate chain</a> <a data-link-type="dfn" href="#certificate-chain-has-a-trusted-leaf" id="ref-for-certificate-chain-has-a-trusted-leaf">does not have a trusted leaf</a> for <var>requestUrl</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin③">origin</a>,
return "untrusted".</p>
    <li data-md>
     <p>Return "trusted".</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Establishing trust in a certificate" data-level="4.9" id="trusting-certificate"><span class="secno">4.9. </span><span class="content">Establishing trust in a certificate</span><a class="self-link" href="#trusting-certificate"></a></h3>
   <p>The <a data-link-type="dfn" href="#certificate-chain" id="ref-for-certificate-chain④">certificate chain</a> <var>chain</var> <dfn class="dfn-paneled" data-dfn-for="certificate chain" data-dfn-type="dfn" data-lt="has a trusted
leaf|does not have a trusted leaf" data-noexport id="certificate-chain-has-a-trusted-leaf">has a trusted leaf</dfn> for an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin">origin</a> <var>origin</var> if the following steps return <code>trusted</code>:</p>
   <ol>
    <li data-md>
     <p>Let <var>leaf</var> be <var>chain</var>’s <a data-link-type="dfn" href="#certificate-chain-leaf" id="ref-for-certificate-chain-leaf⑤">leaf</a>.</p>
    <li data-md>
     <p>Attempt to build a trustworthy path from <var>leaf</var>’s <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate⑤">certificate</a> to a trusted root with</p>
     <ul>
      <li data-md>
       <p><var>chain</var>,</p>
      <li data-md>
       <p><var>leaf</var>’s <a data-link-type="dfn" href="#augmented-certificate-ocsp-response" id="ref-for-augmented-certificate-ocsp-response">OCSP response</a>,</p>
      <li data-md>
       <p>any SCTs from</p>
       <ul>
        <li data-md>
         <p><var>leaf</var>’s <a data-link-type="dfn" href="#augmented-certificate-sct" id="ref-for-augmented-certificate-sct">SCT</a>.</p>
        <li data-md>
         <p>An OCSP extension in <var>leaf</var>’s <a data-link-type="dfn" href="#augmented-certificate-ocsp-response" id="ref-for-augmented-certificate-ocsp-response①">OCSP response</a>.</p>
        <li data-md>
         <p>An X.509 extension in <var>leaf</var>’s <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate⑥">certificate</a>.</p>
       </ul>
     </ul>
     <p>as input, using <a data-link-type="biblio" href="#biblio-rfc5280">[RFC5280]</a> and any other conventions used in making TLS
(<a data-link-type="biblio" href="#biblio-rfc8446">[RFC8446]</a>) connections. The UA SHOULD support Certificate Transparency
(<a data-link-type="biblio" href="#biblio-rfc6962">[RFC6962]</a>) for this check. (See <a href="#seccons-ct">§ 5.1 Certificate Transparency</a>.) The UA MUST check that
it has evidence the <var>leaf</var>’s <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate⑦">certificate</a> was not
revoked 7 or more days ago (for example using the <var>leaf</var>’s <a data-link-type="dfn" href="#augmented-certificate-ocsp-response" id="ref-for-augmented-certificate-ocsp-response②">OCSP response</a>). If no such path can be built, return <code>untrusted</code>.</p>
    <li data-md>
     <p>If <var>leaf</var>’s <a data-link-type="dfn" href="#augmented-certificate-certificate" id="ref-for-augmented-certificate-certificate⑧">certificate</a> is not trusted for <var>origin</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-host" id="ref-for-concept-origin-host">host</a>, return <code>untrusted</code>.</p>
    <li data-md>
     <p>If <var>leaf</var>’s <a data-link-type="dfn" href="#certificate-extensions" id="ref-for-certificate-extensions">extensions</a> don’t map a <a data-link-type="dfn" href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-4.2" id="ref-for-section-4.2②">CanSignHttpExchanges</a> OID to the ASN.1/DER encoding of NULL (0x05 0x00), return <code>untrusted</code>.</p>
    <li data-md>
     <p>Return <code>trusted</code>.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Parsing b2 CBOR headers" data-level="4.10" id="parse-b2-cbor-headers"><span class="secno">4.10. </span><span class="content">Parsing b2 CBOR headers</span><a class="self-link" href="#parse-b2-cbor-headers"></a></h3>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-b2-cbor-headers">Parsing b2 CBOR headers</dfn> from a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①③">byte sequence</a> <var>headerBytes</var> and
a URL <var>requestUrl</var> returns a failure or an <a data-link-type="dfn" href="#exchange" id="ref-for-exchange④">exchange</a> via the following steps:</p>
   <ol>
    <li data-md>
     <p>Let <var>headers</var> be the result of <a data-link-type="dfn" href="https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html#parse-known-length" id="ref-for-parse-known-length">parsing a CBOR item</a> from <var>headerBytes</var>,
matching the following CDDL rule:</p>
<pre>    headers = [
      {
        ':method': bstr,
        * bstr => bstr,
      },
      {
        ':status': bstr,
        * bstr => bstr,
      }
    ]
</pre>
    <li data-md>
     <p>If any of the following is true, return a failure:</p>
     <ul>
      <li data-md>
       <p><var>headers</var> is an error.</p>
      <li data-md>
       <p><var>headers</var>[0] contains any key starting with <code>`:`</code> that isn’t <code>`:method`</code>.</p>
      <li data-md>
       <p><var>headers</var>[0] contains a <code>`host`</code> key.</p>
      <li data-md>
       <p><var>headers</var>[0][<code>`:method`</code>] is not <code>`GET`</code>.</p>
      <li data-md>
       <p><var>headers</var>[1] contains any key starting with <code>`:`</code> that isn’t <code>`:status`</code>.</p>
      <li data-md>
       <p><var>headers</var>[1][<code>`:status`</code>] is not <code>200</code>.</p>
     </ul>
    <li data-md>
     <p>Let <var>requestHeaders</var> be the result of <a data-link-type="dfn" href="#creating-a-header-list-from-the-cbor-map" id="ref-for-creating-a-header-list-from-the-cbor-map">creating a header list from the CBOR
map</a> <var>headers</var>[0].</p>
    <li data-md>
     <p>If <var>requestHeaders</var> is a failure, return it.</p>
    <li data-md>
     <p>Let <var>responseHeaders</var> be the result of <a data-link-type="dfn" href="#creating-a-header-list-from-the-cbor-map" id="ref-for-creating-a-header-list-from-the-cbor-map①">creating a header list from the CBOR
map</a> <var>headers</var>[1].</p>
    <li data-md>
     <p>If <var>responseHeaders</var> is a failure, return it.</p>
    <li data-md>
     <p>If <var>responseHeaders</var> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#header-list-contains" id="ref-for-header-list-contains">does not contain</a> <code>`Content-Type`</code>,
return a failure.</p>
    <li data-md>
     <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-set" id="ref-for-concept-header-list-set②">Set</a> <code>`X-Content-Type-Options`</code>/<code>`nosniff`</code> in <var>responseHeaders</var>.</p>
    <li data-md>
     <p>Let <var>response</var> be a new <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response⑥">response</a> with <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status③">status</a> <var>headers</var>[1][<code>`:status`</code>] and <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list⑤">header list</a> <var>responseHeaders</var>.</p>
    <li data-md>
     <p>Return an <a data-link-type="dfn" href="#exchange" id="ref-for-exchange⑤">exchange</a> of <var>requestUrl</var> and <var>response</var>.</p>
     <p class="note" role="note"><span>Note:</span> This ignores <var>requestHeaders</var>, which can’t be encoded in b3 and later.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Parsing b3 CBOR headers" data-level="4.11" id="parse-cbor-headers"><span class="secno">4.11. </span><span class="content">Parsing b3 CBOR headers</span><a class="self-link" href="#parse-cbor-headers"></a></h3>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-b3-cbor-headers">Parsing b3 CBOR headers</dfn> from a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①④">byte sequence</a> <var>headerBytes</var> and
a URL <var>requestUrl</var> returns a failure or an <a data-link-type="dfn" href="#exchange" id="ref-for-exchange⑥">exchange</a> via the following steps:</p>
   <ol>
    <li data-md>
     <p>Let <var>headers</var> be the result of <a data-link-type="dfn" href="https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html#parse-known-length" id="ref-for-parse-known-length①">parsing a CBOR item</a> from <var>headerBytes</var>,
matching the following CDDL rule:</p>
<pre>    headers = {
      ':status': bstr,
      * bstr => bstr,
    }
</pre>
    <li data-md>
     <p>If any of the following is true, return a failure:</p>
     <ul>
      <li data-md>
       <p><var>headers</var> is an error.</p>
      <li data-md>
       <p><var>headers</var> contains any key starting with <code>`:`</code> that isn’t <code>`:status`</code>.</p>
      <li data-md>
       <p><var>headers</var>[<code>`:status`</code>] is not <code>200</code>.</p>
     </ul>
    <li data-md>
     <p>Let <var>responseHeaders</var> be the result of <a data-link-type="dfn" href="#creating-a-header-list-from-the-cbor-map" id="ref-for-creating-a-header-list-from-the-cbor-map②">creating a header list from the CBOR
map</a> <var>headers</var>.</p>
    <li data-md>
     <p>If <var>responseHeaders</var> is a failure, return it.</p>
    <li data-md>
     <p>Let <var>response</var> be a new <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response⑦">response</a> with <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status④">status</a> <var>headers</var>[<code>`:status`</code>] and <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list⑥">header list</a> <var>responseHeaders</var>.</p>
    <li data-md>
     <p>Return an <a data-link-type="dfn" href="#exchange" id="ref-for-exchange⑦">exchange</a> of <var>requestUrl</var> and <var>response</var>.</p>
   </ol>
   <h4 class="heading settled algorithm" data-algorithm="Converting a map to a header list" data-level="4.11.1" id="headers-from-map"><span class="secno">4.11.1. </span><span class="content">Converting a map to a header list</span><a class="self-link" href="#headers-from-map"></a></h4>
   <p>The result of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="creating-a-header-list-from-the-cbor-map">creating a header list from the CBOR map</dfn> <var>map</var> is
returned by the following steps:</p>
   <ol>
    <li data-md>
     <p>Let <var>headers</var> be a new empty <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list" id="ref-for-concept-header-list">header list</a>.</p>
    <li data-md>
     <p>For each <var>key</var> → <var>value</var> of <var>map</var>:</p>
     <ol>
      <li data-md>
       <p>If <var>key</var> starts with <code>`:`</code>, continue.</p>
      <li data-md>
       <p>If the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#isomorphic-decode" id="ref-for-isomorphic-decode">isomorphic decoding</a> of <var>key</var> contains any <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-upper-alpha" id="ref-for-ascii-upper-alpha">ASCII upper
alpha</a>, return a failure.</p>
      <li data-md>
       <p>If <var>key</var> doesn’t match the constraints on a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-name" id="ref-for-concept-header-name">name</a> or <var>value</var> doesn’t match the constraints on a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-value" id="ref-for-concept-header-value">value</a>, return a failure.</p>
      <li data-md>
       <p class="assertion">Assert: <var>headers</var> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#header-list-contains" id="ref-for-header-list-contains①">does not contain</a> <var>key</var>.</p>
      <li data-md>
       <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-append" id="ref-for-concept-header-list-append">Append</a> <var>key</var>/<var>value</var> to <var>headers</var>.</p>
     </ol>
    <li data-md>
     <p>Return <var>headers</var>.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Creating the response stream." data-level="4.12" id="read-a-body"><span class="secno">4.12. </span><span class="content">Creating the response stream.</span><a class="self-link" href="#read-a-body"></a></h3>
   <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="reading a body|read a body" data-noexport id="reading-a-body">read a body</dfn> from a <a data-link-type="dfn" href="#read-buffer" id="ref-for-read-buffer①">read buffer</a> <var>stream</var> into a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response⑧">response</a> <var>response</var> using an <a data-link-type="dfn" href="#exchange-signature" id="ref-for-exchange-signature⑥">exchange signature</a> <var>signature</var> to check its integrity, the UA MUST:</p>
   <ol>
    <li data-md>
     <p>If <var>signature</var>’s <a data-link-type="dfn" href="#exchange-signature-integrity-header" id="ref-for-exchange-signature-integrity-header①">integrity header</a> is:</p>
     <dl class="switch">
      <dt data-md>«"<code>digest</code>", "<code>mi-sha256-03</code>"»
      <dd data-md>
       <ol>
        <li data-md>
         <p>Let <var>instance-digests</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split" id="ref-for-concept-header-list-get-decode-split">getting,
decoding, and splitting</a> <code>`digest`</code> from <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list⑦">header list</a>.</p>
         <p class="note" role="note"><span>Note:</span> No <a data-link-type="dfn" href="https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml#http-dig-alg-1" id="ref-for-http-dig-alg-1">Digest algorithm</a> uses non-ASCII characters or 0x22
(<code>"</code>), so this is equivalent to parsing from the <a data-link-type="http-header" href="https://tools.ietf.org/html/rfc3230#section-4.3.2" id="ref-for-section-4.3.2">Digest</a> ABNF <code>&lt;encoded digest output></code>.</p>
        <li data-md>
         <p>Let <var>mi</var> be the element of <var>instance-digests</var> that starts with <code>"mi-sha256-03="</code>. If there is no such element, return an error
string "<a data-link-type="dfn" href="#signed-exchange-report-invalid_integrity_header" id="ref-for-signed-exchange-report-invalid_integrity_header">invalid_integrity_header</a>".</p>
        <li data-md>
         <p>Let <var>codings</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split" id="ref-for-concept-header-list-get-decode-split①">getting, decoding, and
splitting</a> <code>`content-encoding`</code> in <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list⑧">header list</a>.</p>
        <li data-md>
         <p>If <var>codings</var> doesn’t include <code>"mi-sha256-03"</code>, return an error string
"<a data-link-type="dfn" href="#signed-exchange-report-invalid_integrity_header" id="ref-for-signed-exchange-report-invalid_integrity_header①">invalid_integrity_header</a>".</p>
        <li data-md>
         <p class="assertion">Assert: <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#handle-content-codings" id="ref-for-handle-content-codings">Handle content codings</a> used the value of <var>mi</var> as the <a data-link-type="dfn" href="https://tools.ietf.org/html/draft-thomson-http-mice-03#section-2.2" id="ref-for-section-2.2">integrity proof for the first record</a> when decoding the <code>mi-sha256-03</code> content encoding to produce the bytes in <var>stream</var>.</p>
       </ol>
      <dt data-md>Anything else
      <dd data-md>
       <p>Return an error string
"<a data-link-type="dfn" href="#signed-exchange-report-invalid_integrity_header" id="ref-for-signed-exchange-report-invalid_integrity_header②">invalid_integrity_header</a>".</p>
     </dl>
    <li data-md>
     <p>Let <var>body</var> be a new <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body" id="ref-for-concept-body">body</a>.</p>
    <li data-md>
     <p>Let <var>cancel</var> be the following steps, taking <var>reason</var> as an argument:</p>
     <ol>
      <li data-md>
       <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-cancel-readablestream" id="ref-for-concept-cancel-readablestream">Cancel</a> <var>stream</var>’s <a data-link-type="dfn" href="#read-buffer-stream" id="ref-for-read-buffer-stream②">stream</a> with <var>reason</var>.</p>
     </ol>
    <li data-md>
     <p>Let <var>outputStream</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-construct-readablestream" id="ref-for-concept-construct-readablestream">constructing a ReadableStream</a> with <var>cancel</var>.</p>
    <li data-md>
     <p>Set <var>body</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream④">stream</a> to <var>outputStream</var>.</p>
    <li data-md>
     <p>Set <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body④">body</a> to <var>body</var>.</p>
    <li data-md>
     <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑥">In parallel</a>:</p>
     <ol>
      <li data-md>
       <p><a data-link-type="dfn" href="#read-buffer-dump" id="ref-for-read-buffer-dump">Dump</a> <var>stream</var> to <var>outputStream</var>.</p>
     </ol>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Request matching" data-level="4.13" id="request-matching"><span class="secno">4.13. </span><span class="content">Request matching</span><a class="self-link" href="#request-matching"></a></h3>
   <p>A <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request③">request</a> <var>browserRequest</var> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="matches-the-stored-exchange">matches the stored exchange</dfn> <var>storedExchange</var> if the following steps return "match":</p>
   <ol>
    <li data-md>
     <p>If <var>browserRequest</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method">method</a> is not <code>`GET`</code> or <code>`HEAD`</code>,
return "mismatch".</p>
     <p class="note" role="note"><span>Note:</span> The <var>browserRequest</var>’s method can be something other than <code>`GET`</code> if a Service Worker intercepts the redirect and modifies the request before
re-fetching it.</p>
    <li data-md>
     <p>If <var>browserRequest</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url①">url</a> is not <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-equals" id="ref-for-concept-url-equals">equal</a> to <var>storedExchange</var>’s <a data-link-type="dfn" href="#exchange-request-url" id="ref-for-exchange-request-url④">request URL</a>, return "mismatch".</p>
    <li data-md>
     <p>If <var>storedExchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response⑨">response</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list⑨">header list</a> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#header-list-contains" id="ref-for-header-list-contains②">contains</a>:</p>
     <dl class="switch">
      <dt data-md>Neither a <code>`Variants`</code> nor a <code>`Variant-Key`</code> header
      <dd data-md>
       <p>Return "match".</p>
       <p class="note" role="note"><span>Note:</span> This states that exactly one resource lives at the request URL, and
no content negotiation is intended.</p>
      <dt data-md>A <code>`Variant-Key`</code> header but no <code>`Variants`</code> header
      <dd data-md>
       <p>Return "mismatch".</p>
       <p class="note" role="note"><span>Note:</span> This indicates a likely misconfiguration, and returning "mismatch"
makes that fail fast.</p>
      <dt data-md>A <code>`Variants`</code> header but no <code>`Variant-Key`</code> header
      <dd data-md>
       <p>Return "mismatch".</p>
       <p class="note" role="note"><span>Note:</span> This behavior is implied by the below steps, but we make it
explicit here.</p>
      <dt data-md>Both a <code>`Variants`</code> and a <code>`Variant-Key`</code> header
      <dd data-md>
       <p>Proceed to the following steps.</p>
     </dl>
    <li data-md>
     <p>If <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-get" id="ref-for-concept-header-list-get">getting</a> <code>`Variants`</code> from <var>storedExchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response①⓪">response</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list①⓪">header list</a> returns a value that fails
to parse according to the instructions for the <a data-link-type="http-header" href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#variants" id="ref-for-variants">Variants</a> Header Field, return "mismatch".</p>
    <li data-md>
     <p>Let <var>acceptableVariantKeys</var> be the result of running the <a data-link-type="dfn" href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#cache" id="ref-for-cache">Variants Cache
Behavior</a> on an incoming-request of <var>browserRequest</var> and stored-responses
of a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②">list</a> containing <var>storedExchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response①①">response</a>.</p>
    <li data-md>
     <p>Let <var>variantKeys</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-get" id="ref-for-concept-header-list-get①">getting</a> <code>`Variant-Key`</code> from <var>storedExchange</var>’s <a data-link-type="dfn" href="#exchange-response" id="ref-for-exchange-response①②">response</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list①①">header list</a>,
and parsing it into a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list③">list</a> of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list④">lists</a> as described in the <a data-link-type="http-header" href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#variant-key" id="ref-for-variant-key">Variant-Key</a> Header Field.</p>
    <li data-md>
     <p>If parsing <var>variantKeys</var> failed, return "mismatch".</p>
    <li data-md>
     <p>If the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#set-intersection" id="ref-for-set-intersection">intersection</a> of <var>acceptableVariantKeys</var> and <var>variantKeys</var> is <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-empty" id="ref-for-list-empty">empty</a>, return "mismatch".</p>
     <p class="issue" id="issue-e1733bef"><a class="self-link" href="#issue-e1733bef"></a> This depends on the <a data-link-type="dfn" href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#cache" id="ref-for-cache①">Variants Cache
Behavior</a> returning a list of lists. <a href="https://github.com/httpwg/http-extensions/issues/744">&lt;https://github.com/httpwg/http-extensions/issues/744></a></p>
    <li data-md>
     <p>Return "match".</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Create a new signed exchange report" data-level="4.14" id="create-a-new-report"><span class="secno">4.14. </span><span class="content">Create a new signed exchange report</span><a class="self-link" href="#create-a-new-report"></a></h3>
    To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-new-signed-exchange-report">create a new signed exchange report</dfn> with <var>request</var> and <var>actualResponse</var>, the UA MUST: 
   <ol>
    <li data-md>
     <p>Let <var>report</var> be a new <a data-link-type="dfn" href="#signed-exchange-report" id="ref-for-signed-exchange-report③">signed exchange report</a> struct.</p>
    <li data-md>
     <p>Set <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-outer-request" id="ref-for-signed-exchange-report-outer-request">outer request</a> to <var>request</var>.</p>
    <li data-md>
     <p>Set <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-outer-response" id="ref-for-signed-exchange-report-outer-response">outer response</a> to <var>actualResponse</var>.</p>
    <li data-md>
     <p>Set <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-server-ip" id="ref-for-signed-exchange-report-server-ip">server IP</a> to the IP address of the
server from which the user agent received the <var>actualResponse</var>, if
available.</p>
    <li data-md>
     <p>Return <var>report</var>.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Wait and queue a report" data-level="4.15" id="wait-and-queue-a-report"><span class="secno">4.15. </span><span class="content">Wait and queue a report</span><a class="self-link" href="#wait-and-queue-a-report"></a></h3>
    To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="wait-and-queue-a-report-for">wait and queue a report for</dfn> <var>parsedExchange</var> and <var>report</var>, the UA
MUST: 
   <ol>
    <li data-md>
     <p>Wait until <var>parsedExchange</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body⑤">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream⑤">stream</a> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-closed" id="ref-for-concept-readablestream-closed">closed</a> or <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored">errored</a>.</p>
    <li data-md>
     <p>If <var>parsedExchange</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body⑥">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream⑥">stream</a> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-closed" id="ref-for-concept-readablestream-closed①">closed</a>, run <a data-link-type="dfn" href="#queue-a-signed-exchange-report" id="ref-for-queue-a-signed-exchange-report①">queue a signed exchange report</a> <var>report</var> with "<a data-link-type="dfn" href="#signed-exchange-report-ok" id="ref-for-signed-exchange-report-ok">ok</a>" as the result and abort these steps.</p>
    <li data-md>
     <p>If <var>parsedExchange</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body⑦">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream⑦">stream</a> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored①">errored</a>, run <a data-link-type="dfn" href="#queue-a-signed-exchange-report" id="ref-for-queue-a-signed-exchange-report②">queue a signed exchange report</a> <var>report</var> with "<a data-link-type="dfn" href="#signed-exchange-report-mi_error" id="ref-for-signed-exchange-report-mi_error">mi_error</a>" as the result.</p>
   </ol>
   <h3 class="heading settled algorithm" data-algorithm="Queuing signed exchange report" data-level="4.16" id="queue-report"><span class="secno">4.16. </span><span class="content">Queuing signed exchange report</span><a class="self-link" href="#queue-report"></a></h3>
   <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="queue-a-signed-exchange-report">queue a signed exchange report</dfn> <var>report</var> with <var>result</var> as the
result, the UA MUST:</p>
   <ol>
    <li data-md>
     <p>Set <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-result" id="ref-for-signed-exchange-report-result③">result</a> to <var>result</var>.</p>
    <li data-md>
     <p>Let <var>report body</var> and <var>policy</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/network-error-logging/#generate-a-network-error-report" id="ref-for-generate-a-network-error-report">generate a network error report</a> with <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-outer-request" id="ref-for-signed-exchange-report-outer-request①">outer request</a>. If the result is null, abort
these steps.</p>
    <li data-md>
     <p>If <var>report body</var>’s <code>"type"</code> is <code>"dns.address_changed"</code>, abort these steps.</p>
     <p class="note" role="note"><span>Note:</span> This means that the NEL report was downgraded because the IP addresses
of the server and the <var>policy</var> don’t match. In this case, the UA has called <a data-link-type="dfn" href="https://w3c.github.io/network-error-logging/#deliver-a-network-report" id="ref-for-deliver-a-network-report">deliver a network report</a> algorithm with the error report while handling
the response. So we don’t need to send the same error report while
processing the response as a signed exchange.</p>
    <li data-md>
     <p>Add a new property <code>"sxg"</code> to <var>report body</var> with a new ECMAScript object with
 the following properties:</p>
     <ul>
      <li data-md>
       <p><code>outer_url</code>: The <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer①">serialization</a> of <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-outer-request" id="ref-for-signed-exchange-report-outer-request②">outer request</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url②">url</a>.</p>
      <li data-md>
       <p><code>inner_url</code>: The <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer②">serialization</a> of <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-inner-url" id="ref-for-signed-exchange-report-inner-url①">inner URL</a>.</p>
      <li data-md>
       <p><code>cert_url</code>: The <a data-link-type="dfn" href="https://heycam.github.io/webidl/#sequence-type" id="ref-for-sequence-type">sequence type</a> of the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer③">serialization</a> of each element of <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-cert-url-list" id="ref-for-signed-exchange-report-cert-url-list②">cert URL list</a>.</p>
     </ul>
    <li data-md>
     <p>Set <var>report body</var>’s <code>"phase"</code> to <code>"sxg"</code>.</p>
    <li data-md>
     <p>If the <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-result" id="ref-for-signed-exchange-report-result④">result</a> is
"<a data-link-type="dfn" href="#signed-exchange-report-ok" id="ref-for-signed-exchange-report-ok①">ok</a>", set <var>report body</var>’s <code>"type"</code> to <code>"ok"</code>.
Otherwise, set <var>report body</var>’s <code>"type"</code> to the result of concatenating a
string <code>"sxg."</code> and the <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-result" id="ref-for-signed-exchange-report-result⑤">result</a>.</p>
    <li data-md>
     <p>If <var>report body</var>’s <code>"sxg"</code>'s <code>"cert_url"</code>'s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme③">scheme</a> is not <code>"data"</code> and <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-result" id="ref-for-signed-exchange-report-result⑥">result</a> is
"<a data-link-type="dfn" href="#signed-exchange-report-signature_verification_error" id="ref-for-signed-exchange-report-signature_verification_error②">signature_verification_error</a>" or
"<a data-link-type="dfn" href="#signed-exchange-report-cert_verification_error" id="ref-for-signed-exchange-report-cert_verification_error①">cert_verification_error</a>" or
"<a data-link-type="dfn" href="#signed-exchange-report-cert_fetch_error" id="ref-for-signed-exchange-report-cert_fetch_error②">cert_fetch_error</a>" or
"<a data-link-type="dfn" href="#signed-exchange-report-cert_parse_error" id="ref-for-signed-exchange-report-cert_parse_error③">cert_parse_error</a>":</p>
     <ol>
      <li data-md>
       <p>If <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-outer-request" id="ref-for-signed-exchange-report-outer-request③">outer request</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url③">url</a>'s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin④">origin</a> is different from any <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin⑤">origin</a> of
the URLs in <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-cert-url-list" id="ref-for-signed-exchange-report-cert-url-list③">cert URL list</a>, or <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-server-ip" id="ref-for-signed-exchange-report-server-ip①">server IP</a> is different from
any of the IP address in <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-cert-server-ip-list" id="ref-for-signed-exchange-report-cert-server-ip-list①">cert server IP list</a>:</p>
       <ol>
        <li data-md>
         <p>Set <var>report body</var>’s <code>"type"</code> to <code>"sxg.failed"</code>.</p>
        <li data-md>
         <p>Set <var>report body</var>’s <code>"elapsed_time"</code> to 0.</p>
       </ol>
     </ol>
     <p class="note" role="note"><span>Note:</span> This step "downgrades" a Signed Exchange report if the certificate
was served from the different server from the server of <code>"outer_url"</code>. This
is intended to avoid leaking the information about the certificate server.</p>
    <li data-md>
     <p><a data-link-type="dfn" href="https://w3c.github.io/network-error-logging/#deliver-a-network-report" id="ref-for-deliver-a-network-report①">Deliver a network report</a> with <var>report body</var> and <var>policy</var> and <var>report</var>’s <a data-link-type="dfn" href="#signed-exchange-report-outer-request" id="ref-for-signed-exchange-report-outer-request④">outer request</a>.</p>
     <div class="example" id="example-network-error-log">
      <a class="self-link" href="#example-network-error-log"></a> If a <a data-link-type="dfn" href="https://w3c.github.io/network-error-logging/#dfn-nel-policies" id="ref-for-dfn-nel-policies">NEL policy</a> was received from the distributor’s origin, <code>distributor.example</code>, this step  will send the following JSON data to
describe an invalid signature: 
<pre class="highlight"><c- p>{</c->
  <c- f>"type"</c-><c- p>:</c-> <c- u>"network-error"</c-><c- p>,</c->
  <c- f>"url"</c-><c- p>:</c-> <c- u>"https://publisher.example/article.html"</c-><c- p>,</c->
  <c- f>"age"</c-><c- p>:</c-> <c- mi>234</c-><c- p>,</c->
  <c- f>"user_agent"</c-><c- p>:</c-> <c- u>"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) ..."</c-><c- p>,</c->
  <c- f>"body"</c-><c- p>:</c-> <c- p>{</c->
    <c- f>"referrer"</c-><c- p>:</c-> <c- u>"https://aggregator.example/article.html"</c-><c- p>,</c->
    <c- f>"sampling_fraction"</c-><c- p>:</c-> <c- mi>1</c-><c- p>,</c->
    <c- f>"server_ip"</c-><c- p>:</c-> <c- u>"192.0.2.42"</c-><c- p>,</c->  // The IP address of distributor.example.
    <c- f>"protocol"</c-><c- p>:</c-> <c- u>"http/1.1"</c-><c- p>,</c->
    <c- f>"method"</c-><c- p>:</c-> <c- u>"GET"</c-><c- p>,</c->
    <c- f>"status_code"</c-><c- p>:</c-> <c- mi>200</c-><c- p>,</c->
    <c- f>"elapsed_time"</c-><c- p>:</c-> <c- mi>1234</c-><c- p>,</c->
    <c- f>"phase"</c-><c- p>:</c-> <c- u>"sxg"</c-><c- p>,</c->
    <c- f>"type"</c-><c- p>:</c-> <c- u>"sxg.signature_verification_error"</c-><c- p>,</c->
    <c- f>"sxg"</c-><c- p>:</c-> <c- p>{</c->
      <c- f>"outer_url"</c-><c- p>:</c-> <c- u>"https://distributor.example/publisher.example/article.html.sxg"</c-><c- p>,</c->
      <c- f>"inner_url"</c-><c- p>:</c-> <c- u>"https://publisher.example/article.html"</c-><c- p>,</c->
      <c- f>"cert_url"</c-><c- p>:</c-> <c- p>[</c-><c- u>"https://distributor.example/publisher.example/cert"</c-><c- p>]</c->
    <c- p>},</c->
  <c- p>}</c->
<c- p>}</c->
</pre>
     </div>
   </ol>
   <h3 class="heading settled" data-level="4.17" id="stream-algs"><span class="secno">4.17. </span><span class="content">Stream algorithms</span><a class="self-link" href="#stream-algs"></a></h3>
   <p class="issue" id="issue-3ffca592"><a class="self-link" href="#issue-3ffca592"></a> The algorithms in this section create and operate over
ECMAScript objects like <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#rs-class" id="ref-for-rs-class①">ReadableStream</a></code> despite not having a Realm to attach
them to. <a href="https://github.com/whatwg/fetch/issues/730">&lt;https://github.com/whatwg/fetch/issues/730></a></p>
   <h4 class="heading settled algorithm" data-algorithm="Create a read buffer" data-level="4.17.1" id="create-read-buffer"><span class="secno">4.17.1. </span><span class="content">Create a read buffer</span><a class="self-link" href="#create-read-buffer"></a></h4>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="new-read-buffer">new read buffer</dfn> for a <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#rs-class" id="ref-for-rs-class②">ReadableStream</a></code> <var>stream</var> is a new <a data-link-type="dfn" href="#read-buffer" id="ref-for-read-buffer②">read
buffer</a> struct whose items are:</p>
   <dl>
    <dt data-md><a data-link-type="dfn" href="#read-buffer-stream" id="ref-for-read-buffer-stream③">stream</a>
    <dd data-md>
     <p><var>stream</var></p>
    <dt data-md><a data-link-type="dfn" href="#read-buffer-reader" id="ref-for-read-buffer-reader">reader</a>
    <dd data-md>
     <p>The result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-get-reader" id="ref-for-concept-get-reader①">getting a reader</a> from <var>stream</var>.</p>
    <dt data-md><a data-link-type="dfn" href="#read-buffer-bytes" id="ref-for-read-buffer-bytes">bytes</a>
    <dd data-md>
     <p>An empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①⑤">byte sequence</a>.</p>
   </dl>
   <h4 class="heading settled algorithm" data-algorithm="Read up to bytes" data-level="4.17.2" id="read-up-to-bytes"><span class="secno">4.17.2. </span><span class="content">Read up to bytes</span><a class="self-link" href="#read-up-to-bytes"></a></h4>
   <p>To <dfn class="dfn-paneled" data-dfn-for="read buffer" data-dfn-type="dfn" data-lt="reading up to" data-noexport id="read-buffer-reading-up-to">read up to</dfn> <var>N</var> bytes from a <a data-link-type="dfn" href="#read-buffer" id="ref-for-read-buffer③">read buffer</a> <var>buffer</var>, the UA MUST:</p>
   <ol>
    <li data-md>
     <p class="assertion">Assert: This algorithm is running <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑦">in parallel</a>.</p>
    <li data-md>
     <p>Let <var>done</var> be <code>false</code>.</p>
    <li data-md>
     <p>While <var>done</var> is <code>false</code> and the length of <var>buffer</var>’s <a data-link-type="dfn" href="#read-buffer-bytes" id="ref-for-read-buffer-bytes①">bytes</a> item is less than <var>N</var> bytes:</p>
     <ol>
      <li data-md>
       <p>Let <var>chunk</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-read-chunk-from-readablestream" id="ref-for-concept-read-chunk-from-readablestream">reading a
chunk</a> with <var>buffer</var>’s <a data-link-type="dfn" href="#read-buffer-reader" id="ref-for-read-buffer-reader①">reader</a>.</p>
      <li data-md>
       <p>Wait for <var>chunk</var> to settle.</p>
      <li data-md>
       <p>If <var>chunk</var> is :</p>
       <dl class="switch">
        <dt data-md>Fulfilled with an object whose <code>done</code> property is <code>false</code> and whose <code>value</code> property is a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-Uint8Array" id="ref-for-idl-Uint8Array">Uint8Array</a></code> object:
        <dd data-md>
         <ol>
          <li data-md>
           <p>Let <var>bs</var> be the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①⑥">byte sequence</a> represented by the <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-Uint8Array" id="ref-for-idl-Uint8Array①">Uint8Array</a></code> object.</p>
          <li data-md>
           <p>Set <var>buffer</var> to the concatenation of <var>buffer</var> and <var>bs</var>.</p>
         </ol>
        <dt data-md>Fulfilled with an object whose <code>done</code> property is <code>true</code>:
        <dd data-md>
         <p>Set <var>done</var> to <code>true</code>.</p>
        <dt data-md>Rejected with <var>e</var>:
        <dd data-md>
         <p>Return a failure with reason <var>e</var>.</p>
       </dl>
     </ol>
    <li data-md>
     <p>If <var>buffer</var>’s <a data-link-type="dfn" href="#read-buffer-bytes" id="ref-for-read-buffer-bytes②">bytes</a> item is at least <var>N</var> bytes long:</p>
     <ol>
      <li data-md>
       <p>Let <var>result</var> be a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①⑦">byte sequence</a> consisting of the first N bytes of <var>buffer</var>’s <a data-link-type="dfn" href="#read-buffer-bytes" id="ref-for-read-buffer-bytes③">bytes</a> item.</p>
      <li data-md>
       <p>Set <var>buffer</var>’s <a data-link-type="dfn" href="#read-buffer-bytes" id="ref-for-read-buffer-bytes④">bytes</a> item to a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①⑧">byte sequence</a> consisting of the bytes after the <var>N</var>th from its old value.</p>
     </ol>
    <li data-md>
     <p>Otherwise:</p>
     <ol>
      <li data-md>
       <p>Let <var>result</var> be <var>buffer</var>’s <a data-link-type="dfn" href="#read-buffer-bytes" id="ref-for-read-buffer-bytes⑤">bytes</a> item.</p>
      <li data-md>
       <p>Set <var>buffer</var>’s <a data-link-type="dfn" href="#read-buffer-bytes" id="ref-for-read-buffer-bytes⑥">bytes</a> item to an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①⑨">byte sequence</a>.</p>
     </ol>
    <li data-md>
     <p>Return <var>result</var>.</p>
   </ol>
   <h4 class="heading settled algorithm" data-algorithm="Read bytes" data-level="4.17.3" id="read-bytes"><span class="secno">4.17.3. </span><span class="content">Read bytes</span><a class="self-link" href="#read-bytes"></a></h4>
   <p>To <dfn class="dfn-paneled" data-dfn-for="read buffer" data-dfn-type="dfn" data-noexport id="read-buffer-read">read</dfn> <var>N</var> bytes from a <a data-link-type="dfn" href="#read-buffer" id="ref-for-read-buffer④">read buffer</a> <var>buffer</var>,
the UA MUST:</p>
   <ol>
    <li data-md>
     <p class="assertion">Assert: This algorithm is running <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑧">in parallel</a>.</p>
    <li data-md>
     <p>Let <var>bytes</var> be the result of <a data-link-type="dfn" href="#read-buffer-reading-up-to" id="ref-for-read-buffer-reading-up-to">reading up to</a> <var>N</var> bytes from <var>buffer</var>.</p>
    <li data-md>
     <p>If <var>bytes</var> is a failure, return it.</p>
    <li data-md>
     <p>If <var>bytes</var> is exactly <var>N</var> bytes long, return it.</p>
    <li data-md>
     <p>Otherwise, return a failure.</p>
   </ol>
   <h4 class="heading settled algorithm" data-algorithm="Dump to another stream" data-level="4.17.4" id="dump-stream"><span class="secno">4.17.4. </span><span class="content">Dump to another stream</span><a class="self-link" href="#dump-stream"></a></h4>
   <p>To <dfn class="dfn-paneled" data-dfn-for="read buffer" data-dfn-type="dfn" data-noexport id="read-buffer-dump">Dump</dfn> a <a data-link-type="dfn" href="#read-buffer" id="ref-for-read-buffer⑤">read buffer</a> <var>input</var> to a <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#rs-class" id="ref-for-rs-class③">ReadableStream</a></code> <var>output</var>, the UA MUST:</p>
   <ol>
    <li data-md>
     <p class="assertion">Assert: This algorithm is running <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑨">in parallel</a>.</p>
    <li data-md>
     <p>Let <var>enqueue</var> be the following steps, taking <var>bytes</var>:</p>
     <ol>
      <li data-md>
       <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-enqueue-readablestream" id="ref-for-concept-enqueue-readablestream">Enqueue</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-Uint8Array" id="ref-for-idl-Uint8Array②">Uint8Array</a></code> object wrapping an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-ArrayBuffer" id="ref-for-idl-ArrayBuffer">ArrayBuffer</a></code> containing <var>bytes</var> to <var>output</var>. Both objects are created
in <var>output</var>’s realm.</p>
      <li data-md>
       <p>If that threw an exception <var>ex</var>, <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored②">error</a> <var>output</var> with <var>ex</var> and <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-cancel-readablestream" id="ref-for-concept-cancel-readablestream①">cancel</a> <var>input</var>’s <a data-link-type="dfn" href="#read-buffer-stream" id="ref-for-read-buffer-stream④">stream</a> with <var>ex</var>.</p>
      <li data-md>
       <p>Abort this algorithm.</p>
     </ol>
    <li data-md>
     <p><var>enqueue</var> <var>input</var>’s <a data-link-type="dfn" href="#read-buffer-bytes" id="ref-for-read-buffer-bytes⑦">bytes</a>.</p>
    <li data-md>
     <p>While <var>input</var>’s <a data-link-type="dfn" href="#read-buffer-stream" id="ref-for-read-buffer-stream⑤">stream</a> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-readable" id="ref-for-concept-readablestream-readable">readable</a>:</p>
     <ol>
      <li data-md>
       <p>Wait until <var>output</var> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-closed" id="ref-for-concept-readablestream-closed②">closed</a>, <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored③">errored</a>, or <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-need-more-data" id="ref-for-concept-readablestream-need-more-data">needs
more data</a>.</p>
      <li data-md>
       <p>If <var>output</var> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-closed" id="ref-for-concept-readablestream-closed③">closed</a> or <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored④">errored</a>, <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-cancel-readablestream" id="ref-for-concept-cancel-readablestream②">cancel</a> <var>input</var>’s <a data-link-type="dfn" href="#read-buffer-stream" id="ref-for-read-buffer-stream⑥">stream</a> and abort
these steps.</p>
      <li data-md>
       <p>Let <var>chunk</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-read-chunk-from-readablestream" id="ref-for-concept-read-chunk-from-readablestream①">reading a
chunk</a> with <var>input</var>’s <a data-link-type="dfn" href="#read-buffer-reader" id="ref-for-read-buffer-reader②">reader</a>.</p>
      <li data-md>
       <p>Wait for <var>chunk</var> to settle.</p>
      <li data-md>
       <p>If <var>chunk</var> is:</p>
       <dl class="switch">
        <dt data-md>Fulfilled with an object whose <code>done</code> property is <code>false</code> and whose <code>value</code> property is a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-Uint8Array" id="ref-for-idl-Uint8Array③">Uint8Array</a></code> object <var>bytes</var>:
        <dd data-md>
         <p><var>enqueue</var> <var>bytes</var>.</p>
        <dt data-md>Fulfilled with an object whose <code>done</code> property is <code>true</code>:
        <dd data-md>
         <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-closed" id="ref-for-concept-readablestream-closed④">Close</a> <var>output</var>.</p>
        <dt data-md>Rejected with <var>e</var>:
        <dd data-md>
         <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored⑤">Error</a> <var>output</var> with reason <var>e</var>.</p>
       </dl>
     </ol>
   </ol>
   <h2 class="heading settled" data-level="5" id="seccons"><span class="secno">5. </span><span class="content">Security Considerations</span><a class="self-link" href="#seccons"></a></h2>
   <p>The Security Considerations of <a data-link-type="biblio" href="#biblio-draft-yasskin-http-origin-signed-responses">[draft-yasskin-http-origin-signed-responses]</a> apply.</p>
   <h3 class="heading settled" data-level="5.1" id="seccons-ct"><span class="secno">5.1. </span><span class="content">Certificate Transparency</span><a class="self-link" href="#seccons-ct"></a></h3>
   <p>To identify <a data-link-type="dfn" href="https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#seccons-off-path" id="ref-for-seccons-off-path">off-path attackers</a>, <a href="#trusting-certificate">§ 4.9 Establishing trust in a certificate</a> encourages UAs to
implement Certificate Transparency, which requires that, in order for a
certificate to be trusted, it must be logged publicly. This means that an
off-path attacker who has managed to get a mis-issued certificate has to at
least announce that certificate in a place the legitimate domain owner has a
chance to notice. Once they notice, they can revoke the certificate, which will
stop the UA from trusting it no more than 7 days later.</p>
  </main>
  <div data-fill-with="conformance">
   <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
   <p> Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology.
            The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL”
            in the normative parts of this document
            are to be interpreted as described in RFC 2119.
            However, for readability,
            these words do not appear in all uppercase letters in this specification. </p>
   <p> All of the text of this specification is normative
            except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
   <p> Examples in this specification are introduced with the words “for example”
            or are set apart from the normative text with <code>class="example"</code>, like this: </p>
   <div class="example" id="example-example"><a class="self-link" href="#example-example"></a> This is an example of an informative example. </div>
   <p> Informative notes begin with the word “Note”
            and are set apart from the normative text with <code>class="note"</code>, like this: </p>
   <p class="note" role="note"> Note, this is an informative note. </p>
  </div>
<script>
(function() {
  "use strict";
  var collapseSidebarText = '<span aria-hidden="true">←</span> '
                          + '<span>Collapse Sidebar</span>';
  var expandSidebarText   = '<span aria-hidden="true">→</span> '
                          + '<span>Pop Out Sidebar</span>';
  var tocJumpText         = '<span aria-hidden="true">↑</span> '
                          + '<span>Jump to Table of Contents</span>';

  var sidebarMedia = window.matchMedia('screen and (min-width: 78em)');
  var autoToggle   = function(e){ toggleSidebar(e.matches) };
  if(sidebarMedia.addListener) {
    sidebarMedia.addListener(autoToggle);
  }

  function toggleSidebar(on) {
    if (on == undefined) {
      on = !document.body.classList.contains('toc-sidebar');
    }

    /* Don’t scroll to compensate for the ToC if we’re above it already. */
    var headY = 0;
    var head = document.querySelector('.head');
    if (head) {
      // terrible approx of "top of ToC"
      headY += head.offsetTop + head.offsetHeight;
    }
    var skipScroll = window.scrollY < headY;

    var toggle = document.getElementById('toc-toggle');
    var tocNav = document.getElementById('toc');
    if (on) {
      var tocHeight = tocNav.offsetHeight;
      document.body.classList.add('toc-sidebar');
      document.body.classList.remove('toc-inline');
      toggle.innerHTML = collapseSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, 0 - tocHeight);
      }
      tocNav.focus();
      sidebarMedia.addListener(autoToggle); // auto-collapse when out of room
    }
    else {
      document.body.classList.add('toc-inline');
      document.body.classList.remove('toc-sidebar');
      toggle.innerHTML = expandSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, tocNav.offsetHeight);
      }
      if (toggle.matches(':hover')) {
        /* Unfocus button when not using keyboard navigation,
           because I don’t know where else to send the focus. */
        toggle.blur();
      }
    }
  }

  function createSidebarToggle() {
    /* Create the sidebar toggle in JS; it shouldn’t exist when JS is off. */
    var toggle = document.createElement('a');
      /* This should probably be a button, but appearance isn’t standards-track.*/
    toggle.id = 'toc-toggle';
    toggle.class = 'toc-toggle';
    toggle.href = '#toc';
    toggle.innerHTML = collapseSidebarText;

    sidebarMedia.addListener(autoToggle);
    var toggler = function(e) {
      e.preventDefault();
      sidebarMedia.removeListener(autoToggle); // persist explicit off states
      toggleSidebar();
      return false;
    }
    toggle.addEventListener('click', toggler, false);


    /* Get <nav id=toc-nav>, or make it if we don’t have one. */
    var tocNav = document.getElementById('toc-nav');
    if (!tocNav) {
      tocNav = document.createElement('p');
      tocNav.id = 'toc-nav';
      /* Prepend for better keyboard navigation */
      document.body.insertBefore(tocNav, document.body.firstChild);
    }
    /* While we’re at it, make sure we have a Jump to Toc link. */
    var tocJump = document.getElementById('toc-jump');
    if (!tocJump) {
      tocJump = document.createElement('a');
      tocJump.id = 'toc-jump';
      tocJump.href = '#toc';
      tocJump.innerHTML = tocJumpText;
      tocNav.appendChild(tocJump);
    }

    tocNav.appendChild(toggle);
  }

  var toc = document.getElementById('toc');
  if (toc) {
    createSidebarToggle();
    toggleSidebar(sidebarMedia.matches);

    /* If the sidebar has been manually opened and is currently overlaying the text
       (window too small for the MQ to add the margin to body),
       then auto-close the sidebar once you click on something in there. */
    toc.addEventListener('click', function(e) {
      if(e.target.tagName.toLowerCase() == "a" && document.body.classList.contains('toc-sidebar') && !sidebarMedia.matches) {
        toggleSidebar(false);
      }
    }, false);
  }
  else {
    console.warn("Can’t find Table of Contents. Please use <nav id='toc'> around the ToC.");
  }

  /* Wrap tables in case they overflow */
  var tables = document.querySelectorAll(':not(.overlarge) > table.data, :not(.overlarge) > table.index');
  var numTables = tables.length;
  for (var i = 0; i < numTables; i++) {
    var table = tables[i];
    var wrapper = document.createElement('div');
    wrapper.className = 'overlarge';
    table.parentNode.insertBefore(wrapper, table);
    wrapper.appendChild(table);
  }

})();
</script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#public-key-algorithm">algorithm</a><span>, in §3.3</span>
   <li><a href="#augmented-certificate">Augmented Certificate</a><span>, in §3.2</span>
   <li><a href="#read-buffer-bytes">bytes</a><span>, in §3.2</span>
   <li><a href="#signed-exchange-report-cert_fetch_error">cert_fetch_error</a><span>, in §3.4</span>
   <li><a href="#augmented-certificate-certificate">certificate</a><span>, in §3.3</span>
   <li>
    certificate chain
    <ul>
     <li><a href="#certificate-chain">definition of</a><span>, in §3.3</span>
     <li><a href="#exchange-signature-certificate-chain">dfn for exchange signature</a><span>, in §3.5</span>
    </ul>
   <li><a href="#signed-exchange-report-cert_parse_error">cert_parse_error</a><span>, in §3.4</span>
   <li><a href="#signed-exchange-report-cert-server-ip-list">cert server IP list</a><span>, in §3.4</span>
   <li><a href="#exchange-signature-certsha256">certSha256</a><span>, in §3.5</span>
   <li><a href="#signed-exchange-report-cert-url-list">cert URL list</a><span>, in §3.4</span>
   <li><a href="#signed-exchange-report-cert_verification_error">cert_verification_error</a><span>, in §3.4</span>
   <li><a href="#create-a-new-signed-exchange-report">create a new signed exchange report</a><span>, in §4.14</span>
   <li><a href="#creating-a-header-list-from-the-cbor-map">creating a header list from the CBOR map</a><span>, in §4.11.1</span>
   <li>
    date
    <ul>
     <li><a href="#exchange-signature-date">dfn for exchange signature</a><span>, in §3.5</span>
     <li><a href="#response-date">dfn for response</a><span>, in §2.3</span>
    </ul>
   <li><a href="#exchange-signature-establishes-cross-origin-trust">does not establish cross-origin trust</a><span>, in §4.8</span>
   <li><a href="#certificate-chain-has-a-trusted-leaf">does not have a trusted leaf</a><span>, in §4.9</span>
   <li><a href="#read-buffer-dump">Dump</a><span>, in §4.17.4</span>
   <li><a href="#exchange-signature-establishes-cross-origin-trust">establishes cross-origin trust</a><span>, in §4.8</span>
   <li><a href="#exchange">Exchange</a><span>, in §3</span>
   <li><a href="#exchange-signature">Exchange Signature</a><span>, in §3.4</span>
   <li><a href="#exchange-signature-expiration-time">expiration time</a><span>, in §3.5</span>
   <li><a href="#certificate-extensions">extensions</a><span>, in §3.3</span>
   <li><a href="#extracting-the-fallback-url">Extracting the fallback URL</a><span>, in §4.2</span>
   <li><a href="#handling-the-certificate-reference">Handling the certificate reference</a><span>, in §4.5.1</span>
   <li><a href="#certificate-chain-has-a-trusted-leaf">has a trusted leaf</a><span>, in §4.9</span>
   <li><a href="#signed-exchange-report-inner-url">inner URL</a><span>, in §3.4</span>
   <li><a href="#exchange-signature-integrity-header">integrity header</a><span>, in §3.5</span>
   <li><a href="#signed-exchange-report-invalid_integrity_header">invalid_integrity_header</a><span>, in §3.4</span>
   <li><a href="#exchange-signature-is-valid">is not valid</a><span>, in §4.7</span>
   <li><a href="#exchange-signature-is-valid">is valid</a><span>, in §4.7</span>
   <li><a href="#certificate-chain-leaf">leaf</a><span>, in §3.3</span>
   <li><a href="#matches-the-stored-exchange">matches the stored exchange</a><span>, in §4.13</span>
   <li><a href="#signed-exchange-report-mi_error">mi_error</a><span>, in §3.4</span>
   <li><a href="#new-read-buffer">new read buffer</a><span>, in §4.17.1</span>
   <li><a href="#signed-exchange-report-non_secure_distributor">non_secure_distributor</a><span>, in §3.4</span>
   <li><a href="#augmented-certificate-ocsp-response">OCSP response</a><span>, in §3.3</span>
   <li><a href="#signed-exchange-report-ok">ok</a><span>, in §3.4</span>
   <li><a href="#signed-exchange-report-outer-request">outer request</a><span>, in §3.4</span>
   <li><a href="#signed-exchange-report-outer-response">outer response</a><span>, in §3.4</span>
   <li><a href="#signed-exchange-report-parse_error">parse_error</a><span>, in §3.4</span>
   <li><a href="#parsing-a-signed-exchange">Parsing a signed exchange</a><span>, in §4.3</span>
   <li><a href="#parsing-b2-cbor-headers">Parsing b2 CBOR headers</a><span>, in §4.10</span>
   <li><a href="#parsing-b3-cbor-headers">Parsing b3 CBOR headers</a><span>, in §4.11</span>
   <li><a href="#parsing-the-invariant-prefix">Parsing the invariant prefix</a><span>, in §4.4</span>
   <li><a href="#parsing-the-signature-header-field">Parsing the Signature header field</a><span>, in §4.5</span>
   <li><a href="#certificate-public-key">public key</a><span>, in §3.3</span>
   <li><a href="#queue-a-signed-exchange-report">queue a signed exchange report</a><span>, in §4.16</span>
   <li><a href="#read-buffer-read">read</a><span>, in §4.17.3</span>
   <li><a href="#reading-a-body">read a body</a><span>, in §4.12</span>
   <li><a href="#read-buffer">Read buffer</a><span>, in §3.1</span>
   <li><a href="#read-buffer-reader">reader</a><span>, in §3.2</span>
   <li><a href="#reading-a-body">reading a body</a><span>, in §4.12</span>
   <li><a href="#read-buffer-reading-up-to">reading up to</a><span>, in §4.17.2</span>
   <li><a href="#exchange-request-url">request URL</a><span>, in §3.1</span>
   <li><a href="#exchange-response">response</a><span>, in §3.1</span>
   <li><a href="#signed-exchange-report-result">result</a><span>, in §3.4</span>
   <li><a href="#augmented-certificate-sct">SCT</a><span>, in §3.3</span>
   <li><a href="#signed-exchange-report-server-ip">server IP</a><span>, in §3.4</span>
   <li><a href="#exchange-signature-signature">signature</a><span>, in §3.5</span>
   <li><a href="#signed-exchange-report-signature_verification_error">signature_verification_error</a><span>, in §3.4</span>
   <li><a href="#signed-exchange-report">Signed Exchange report</a><span>, in §3.3</span>
   <li><a href="#signed-exchange-version">signed exchange version</a><span>, in §4.1</span>
   <li><a href="#signed-message">signed message</a><span>, in §4.6</span>
   <li><a href="#request-stashed-exchange">stashed exchange</a><span>, in §2.1</span>
   <li><a href="#read-buffer-stream">stream</a><span>, in §3.2</span>
   <li><a href="#exchange-signature-validityurl">validityUrl</a><span>, in §3.5</span>
   <li><a href="#exchange-signature-validityurlbytes">validityUrlBytes</a><span>, in §3.5</span>
   <li><a href="#wait-and-queue-a-report-for">wait and queue a report for</a><span>, in §4.15</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-section-4.2">
   <a href="https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2">https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-4.2①">4.5. Parsing a Signature Header Field</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-variant-key">
   <a href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#variant-key">https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#variant-key</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-variant-key">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-variants">
   <a href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#variants">https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#variants</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-variants">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-cache">
   <a href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#cache">https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#cache</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache">4.13. Request matching</a> <a href="#ref-for-cache①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-2.2">
   <a href="https://tools.ietf.org/html/draft-thomson-http-mice-03#section-2.2">https://tools.ietf.org/html/draft-thomson-http-mice-03#section-2.2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-2.2">4.12. Creating the response stream.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-seccons-off-path">
   <a href="https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#seccons-off-path">https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#seccons-off-path</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-seccons-off-path">5.1. Certificate Transparency</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-uncached-headers">
   <a href="https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#uncached-headers">https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#uncached-headers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-uncached-headers">4.8. Cross-origin trust</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-3.4">
   <a href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-3.4">https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-3.4</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-3.4">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-4.2">
   <a href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-4.2">https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-4.2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-4.2②">4.9. Establishing trust in a certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-3.3">
   <a href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-3.3">https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02#section-3.3</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-3.3①">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-parse-known-length">
   <a href="https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html#parse-known-length">https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html#parse-known-length</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parse-known-length">4.10. Parsing b2 CBOR headers</a>
    <li><a href="#ref-for-parse-known-length①">4.11. Parsing b3 CBOR headers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-utf-8-decode-without-bom-or-fail">
   <a href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail">https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-utf-8-decode-without-bom-or-fail">4.4. Parsing the invariant prefix</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-requestcache-only-if-cached">
   <a href="https://fetch.spec.whatwg.org/#dom-requestcache-only-if-cached">https://fetch.spec.whatwg.org/#dom-requestcache-only-if-cached</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-requestcache-only-if-cached">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-request">
   <a href="https://fetch.spec.whatwg.org/#request">https://fetch.spec.whatwg.org/#request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-list-append">
   <a href="https://fetch.spec.whatwg.org/#concept-header-list-append">https://fetch.spec.whatwg.org/#concept-header-list-append</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-list-append">4.11.1. Converting a map to a header list</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-body">
   <a href="https://fetch.spec.whatwg.org/#concept-response-body">https://fetch.spec.whatwg.org/#concept-response-body</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-body">4.2. Extracting the fallback URL</a>
    <li><a href="#ref-for-concept-response-body①">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-concept-response-body②">4.5.1. Handling the certificate reference</a> <a href="#ref-for-concept-response-body③">(2)</a>
    <li><a href="#ref-for-concept-response-body④">4.12. Creating the response stream.</a>
    <li><a href="#ref-for-concept-response-body⑤">4.15. Wait and queue a report</a> <a href="#ref-for-concept-response-body⑥">(2)</a> <a href="#ref-for-concept-response-body⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-request-cache">
   <a href="https://fetch.spec.whatwg.org/#dom-request-cache">https://fetch.spec.whatwg.org/#dom-request-cache</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-request-cache">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-cache-mode">
   <a href="https://fetch.spec.whatwg.org/#concept-request-cache-mode">https://fetch.spec.whatwg.org/#concept-request-cache-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-cache-mode">2.5. Monkeypatch HTTP-network-or-cache fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-cancel-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-cancel-readablestream">https://fetch.spec.whatwg.org/#concept-cancel-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-cancel-readablestream">4.12. Creating the response stream.</a>
    <li><a href="#ref-for-concept-cancel-readablestream①">4.17.4. Dump to another stream</a> <a href="#ref-for-concept-cancel-readablestream②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-client">
   <a href="https://fetch.spec.whatwg.org/#concept-request-client">https://fetch.spec.whatwg.org/#concept-request-client</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-client">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-concept-request-client①">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-clone">
   <a href="https://fetch.spec.whatwg.org/#concept-response-clone">https://fetch.spec.whatwg.org/#concept-response-clone</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-clone">2.2. Request clone</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-request-clone">
   <a href="https://fetch.spec.whatwg.org/#dom-request-clone">https://fetch.spec.whatwg.org/#dom-request-clone</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-request-clone">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream-closed">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream-closed">https://fetch.spec.whatwg.org/#concept-readablestream-closed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream-closed">4.15. Wait and queue a report</a> <a href="#ref-for-concept-readablestream-closed①">(2)</a>
    <li><a href="#ref-for-concept-readablestream-closed②">4.17.4. Dump to another stream</a> <a href="#ref-for-concept-readablestream-closed③">(2)</a> <a href="#ref-for-concept-readablestream-closed④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-construct-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-construct-readablestream">https://fetch.spec.whatwg.org/#concept-construct-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-construct-readablestream">4.12. Creating the response stream.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-header-list-contains">
   <a href="https://fetch.spec.whatwg.org/#header-list-contains">https://fetch.spec.whatwg.org/#header-list-contains</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-header-list-contains">4.10. Parsing b2 CBOR headers</a>
    <li><a href="#ref-for-header-list-contains①">4.11.1. Converting a map to a header list</a>
    <li><a href="#ref-for-header-list-contains②">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-determine-nosniff">
   <a href="https://fetch.spec.whatwg.org/#determine-nosniff">https://fetch.spec.whatwg.org/#determine-nosniff</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-determine-nosniff">4.1. Identifying signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-header-list-contains">
   <a href="https://fetch.spec.whatwg.org/#header-list-contains">https://fetch.spec.whatwg.org/#header-list-contains</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-header-list-contains">4.10. Parsing b2 CBOR headers</a>
    <li><a href="#ref-for-header-list-contains①">4.11.1. Converting a map to a header list</a>
    <li><a href="#ref-for-header-list-contains②">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-enqueue-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-enqueue-readablestream">https://fetch.spec.whatwg.org/#concept-enqueue-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-enqueue-readablestream">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream-errored">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream-errored">https://fetch.spec.whatwg.org/#concept-readablestream-errored</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream-errored">4.15. Wait and queue a report</a> <a href="#ref-for-concept-readablestream-errored①">(2)</a>
    <li><a href="#ref-for-concept-readablestream-errored②">4.17.4. Dump to another stream</a> <a href="#ref-for-concept-readablestream-errored③">(2)</a> <a href="#ref-for-concept-readablestream-errored④">(3)</a> <a href="#ref-for-concept-readablestream-errored⑤">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-extract-mime-type">
   <a href="https://fetch.spec.whatwg.org/#concept-header-extract-mime-type">https://fetch.spec.whatwg.org/#concept-header-extract-mime-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-extract-mime-type">4.1. Identifying signed exchanges</a>
    <li><a href="#ref-for-concept-header-extract-mime-type①">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-extract-header-list-values">
   <a href="https://fetch.spec.whatwg.org/#extract-header-list-values">https://fetch.spec.whatwg.org/#extract-header-list-values</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extract-header-list-values">2.3. Response date</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-fetch">
   <a href="https://fetch.spec.whatwg.org/#concept-fetch">https://fetch.spec.whatwg.org/#concept-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-fetch">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-global-fetch">
   <a href="https://fetch.spec.whatwg.org/#dom-global-fetch">https://fetch.spec.whatwg.org/#dom-global-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-global-fetch">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-list-get">
   <a href="https://fetch.spec.whatwg.org/#concept-header-list-get">https://fetch.spec.whatwg.org/#concept-header-list-get</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-list-get">4.13. Request matching</a> <a href="#ref-for-concept-header-list-get①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-get-reader">
   <a href="https://fetch.spec.whatwg.org/#concept-get-reader">https://fetch.spec.whatwg.org/#concept-get-reader</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-get-reader">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-concept-get-reader①">4.17.1. Create a read buffer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-list-get-decode-split">
   <a href="https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split">https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-list-get-decode-split">4.12. Creating the response stream.</a> <a href="#ref-for-concept-header-list-get-decode-split①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-handle-content-codings">
   <a href="https://fetch.spec.whatwg.org/#handle-content-codings">https://fetch.spec.whatwg.org/#handle-content-codings</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-handle-content-codings">4.12. Creating the response stream.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-header-list">
   <a href="https://fetch.spec.whatwg.org/#concept-response-header-list">https://fetch.spec.whatwg.org/#concept-response-header-list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-header-list">2.3. Response date</a>
    <li><a href="#ref-for-concept-response-header-list①">4.1. Identifying signed exchanges</a> <a href="#ref-for-concept-response-header-list②">(2)</a>
    <li><a href="#ref-for-concept-response-header-list③">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-concept-response-header-list④">4.8. Cross-origin trust</a>
    <li><a href="#ref-for-concept-response-header-list⑤">4.10. Parsing b2 CBOR headers</a>
    <li><a href="#ref-for-concept-response-header-list⑥">4.11. Parsing b3 CBOR headers</a>
    <li><a href="#ref-for-concept-response-header-list⑦">4.12. Creating the response stream.</a> <a href="#ref-for-concept-response-header-list⑧">(2)</a>
    <li><a href="#ref-for-concept-response-header-list⑨">4.13. Request matching</a> <a href="#ref-for-concept-response-header-list①⓪">(2)</a> <a href="#ref-for-concept-response-header-list①①">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-http-fetch">
   <a href="https://fetch.spec.whatwg.org/#concept-http-fetch">https://fetch.spec.whatwg.org/#concept-http-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-http-fetch">2.4. Monkeypatch HTTP fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-http-network-fetch">
   <a href="https://fetch.spec.whatwg.org/#concept-http-network-fetch">https://fetch.spec.whatwg.org/#concept-http-network-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-http-network-fetch">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-http-network-or-cache-fetch">
   <a href="https://fetch.spec.whatwg.org/#concept-http-network-or-cache-fetch">https://fetch.spec.whatwg.org/#concept-http-network-or-cache-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-http-network-or-cache-fetch">2.5. Monkeypatch HTTP-network-or-cache fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-https-state">
   <a href="https://fetch.spec.whatwg.org/#concept-response-https-state">https://fetch.spec.whatwg.org/#concept-response-https-state</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-https-state">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-initiator">
   <a href="https://fetch.spec.whatwg.org/#concept-request-initiator">https://fetch.spec.whatwg.org/#concept-request-initiator</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-initiator">2.5. Monkeypatch HTTP-network-or-cache fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-method">
   <a href="https://fetch.spec.whatwg.org/#concept-request-method">https://fetch.spec.whatwg.org/#concept-request-method</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-method">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-mode">
   <a href="https://fetch.spec.whatwg.org/#concept-request-mode">https://fetch.spec.whatwg.org/#concept-request-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-mode">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-name">
   <a href="https://fetch.spec.whatwg.org/#concept-header-name">https://fetch.spec.whatwg.org/#concept-header-name</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-name">4.11.1. Converting a map to a header list</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream-need-more-data">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream-need-more-data">https://fetch.spec.whatwg.org/#concept-readablestream-need-more-data</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream-need-more-data">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-network-error">
   <a href="https://fetch.spec.whatwg.org/#concept-network-error">https://fetch.spec.whatwg.org/#concept-network-error</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-network-error">2.4. Monkeypatch HTTP fetch</a> <a href="#ref-for-concept-network-error①">(2)</a>
    <li><a href="#ref-for-concept-network-error②">2.5. Monkeypatch HTTP-network-or-cache fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-read-chunk-from-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-read-chunk-from-readablestream">https://fetch.spec.whatwg.org/#concept-read-chunk-from-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-read-chunk-from-readablestream">4.17.2. Read up to bytes</a>
    <li><a href="#ref-for-concept-read-chunk-from-readablestream①">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-read-all-bytes-from-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream">https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-read-all-bytes-from-readablestream">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream-readable">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream-readable">https://fetch.spec.whatwg.org/#concept-readablestream-readable</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream-readable">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-redirect-status">
   <a href="https://fetch.spec.whatwg.org/#redirect-status">https://fetch.spec.whatwg.org/#redirect-status</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-redirect-status">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-redirect-status①">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request">
   <a href="https://fetch.spec.whatwg.org/#concept-request">https://fetch.spec.whatwg.org/#concept-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request">2.1. A request’s stashed exchange</a>
    <li><a href="#ref-for-concept-request①">3.4. Signed Exchange report</a>
    <li><a href="#ref-for-concept-request②">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-concept-request③">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response">
   <a href="https://fetch.spec.whatwg.org/#concept-response">https://fetch.spec.whatwg.org/#concept-response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response">2.3. Response date</a>
    <li><a href="#ref-for-concept-response①">3.1. Exchange</a>
    <li><a href="#ref-for-concept-response②">3.4. Signed Exchange report</a>
    <li><a href="#ref-for-concept-response③">4.1. Identifying signed exchanges</a>
    <li><a href="#ref-for-concept-response④">4.2. Extracting the fallback URL</a>
    <li><a href="#ref-for-concept-response⑤">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-concept-response⑥">4.10. Parsing b2 CBOR headers</a>
    <li><a href="#ref-for-concept-response⑦">4.11. Parsing b3 CBOR headers</a>
    <li><a href="#ref-for-concept-response⑧">4.12. Creating the response stream.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-request-service-workers-mode">
   <a href="https://fetch.spec.whatwg.org/#request-service-workers-mode">https://fetch.spec.whatwg.org/#request-service-workers-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-service-workers-mode">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-list-set">
   <a href="https://fetch.spec.whatwg.org/#concept-header-list-set">https://fetch.spec.whatwg.org/#concept-header-list-set</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-list-set">2.4. Monkeypatch HTTP fetch</a> <a href="#ref-for-concept-header-list-set①">(2)</a>
    <li><a href="#ref-for-concept-header-list-set②">4.10. Parsing b2 CBOR headers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-status">
   <a href="https://fetch.spec.whatwg.org/#concept-response-status">https://fetch.spec.whatwg.org/#concept-response-status</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-status">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-concept-response-status①">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-concept-response-status②">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-concept-response-status③">4.10. Parsing b2 CBOR headers</a>
    <li><a href="#ref-for-concept-response-status④">4.11. Parsing b3 CBOR headers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-body-stream">
   <a href="https://fetch.spec.whatwg.org/#concept-body-stream">https://fetch.spec.whatwg.org/#concept-body-stream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-body-stream">4.2. Extracting the fallback URL</a>
    <li><a href="#ref-for-concept-body-stream①">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-concept-body-stream②">4.5.1. Handling the certificate reference</a> <a href="#ref-for-concept-body-stream③">(2)</a>
    <li><a href="#ref-for-concept-body-stream④">4.12. Creating the response stream.</a>
    <li><a href="#ref-for-concept-body-stream⑤">4.15. Wait and queue a report</a> <a href="#ref-for-concept-body-stream⑥">(2)</a> <a href="#ref-for-concept-body-stream⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-url">
   <a href="https://fetch.spec.whatwg.org/#concept-response-url">https://fetch.spec.whatwg.org/#concept-response-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-url">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-value">
   <a href="https://fetch.spec.whatwg.org/#concept-header-value">https://fetch.spec.whatwg.org/#concept-header-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-value">4.11.1. Converting a map to a header list</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-environment-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-environment-settings-object">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-environment-settings-object①">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-environment-settings-object②">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-origin-host">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-host">https://html.spec.whatwg.org/multipage/origin.html#concept-origin-host</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-origin-host">4.9. Establishing trust in a certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-in-parallel">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-in-parallel">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-in-parallel①">4.2. Extracting the fallback URL</a>
    <li><a href="#ref-for-in-parallel②">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-in-parallel③">4.4. Parsing the invariant prefix</a>
    <li><a href="#ref-for-in-parallel④">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-in-parallel⑤">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-in-parallel⑥">4.12. Creating the response stream.</a>
    <li><a href="#ref-for-in-parallel⑦">4.17.2. Read up to bytes</a>
    <li><a href="#ref-for-in-parallel⑧">4.17.3. Read bytes</a>
    <li><a href="#ref-for-in-parallel⑨">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-origin">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin">https://html.spec.whatwg.org/multipage/origin.html#concept-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-origin">4.9. Establishing trust in a certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-same-origin">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#same-origin">https://html.spec.whatwg.org/multipage/origin.html#same-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-same-origin">4.8. Cross-origin trust</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-http-dig-alg-1">
   <a href="https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml#http-dig-alg-1">https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml#http-dig-alg-1</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-http-dig-alg-1">4.12. Creating the response stream.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ascii-byte">
   <a href="https://infra.spec.whatwg.org/#ascii-byte">https://infra.spec.whatwg.org/#ascii-byte</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ascii-byte">4.5. Parsing a Signature Header Field</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ascii-decode">
   <a href="https://infra.spec.whatwg.org/#ascii-decode">https://infra.spec.whatwg.org/#ascii-decode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ascii-decode">4.5. Parsing a Signature Header Field</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ascii-encode">
   <a href="https://infra.spec.whatwg.org/#ascii-encode">https://infra.spec.whatwg.org/#ascii-encode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ascii-encode">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-ascii-encode①">4.5. Parsing a Signature Header Field</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ascii-string">
   <a href="https://infra.spec.whatwg.org/#ascii-string">https://infra.spec.whatwg.org/#ascii-string</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ascii-string">3.5. Exchange Signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ascii-upper-alpha">
   <a href="https://infra.spec.whatwg.org/#ascii-upper-alpha">https://infra.spec.whatwg.org/#ascii-upper-alpha</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ascii-upper-alpha">4.11.1. Converting a map to a header list</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-byte-sequence">
   <a href="https://infra.spec.whatwg.org/#byte-sequence">https://infra.spec.whatwg.org/#byte-sequence</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-byte-sequence">3.2. Read buffer</a>
    <li><a href="#ref-for-byte-sequence①">3.3. Augmented Certificate</a> <a href="#ref-for-byte-sequence②">(2)</a> <a href="#ref-for-byte-sequence③">(3)</a> <a href="#ref-for-byte-sequence④">(4)</a> <a href="#ref-for-byte-sequence⑤">(5)</a>
    <li><a href="#ref-for-byte-sequence⑥">3.5. Exchange Signature</a> <a href="#ref-for-byte-sequence⑦">(2)</a>
    <li><a href="#ref-for-byte-sequence⑧">4.4. Parsing the invariant prefix</a> <a href="#ref-for-byte-sequence⑨">(2)</a>
    <li><a href="#ref-for-byte-sequence①⓪">4.6. The signed message</a> <a href="#ref-for-byte-sequence①①">(2)</a>
    <li><a href="#ref-for-byte-sequence①②">4.7. Validating a signature</a>
    <li><a href="#ref-for-byte-sequence①③">4.10. Parsing b2 CBOR headers</a>
    <li><a href="#ref-for-byte-sequence①④">4.11. Parsing b3 CBOR headers</a>
    <li><a href="#ref-for-byte-sequence①⑤">4.17.1. Create a read buffer</a>
    <li><a href="#ref-for-byte-sequence①⑥">4.17.2. Read up to bytes</a> <a href="#ref-for-byte-sequence①⑦">(2)</a> <a href="#ref-for-byte-sequence①⑧">(3)</a> <a href="#ref-for-byte-sequence①⑨">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-empty">
   <a href="https://infra.spec.whatwg.org/#list-empty">https://infra.spec.whatwg.org/#list-empty</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-empty">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-set-intersection">
   <a href="https://infra.spec.whatwg.org/#set-intersection">https://infra.spec.whatwg.org/#set-intersection</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-set-intersection">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-isomorphic-decode">
   <a href="https://infra.spec.whatwg.org/#isomorphic-decode">https://infra.spec.whatwg.org/#isomorphic-decode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-isomorphic-decode">4.11.1. Converting a map to a header list</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-item">
   <a href="https://infra.spec.whatwg.org/#list-item">https://infra.spec.whatwg.org/#list-item</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-item">3.3. Augmented Certificate</a>
    <li><a href="#ref-for-list-item①">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list">
   <a href="https://infra.spec.whatwg.org/#list">https://infra.spec.whatwg.org/#list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list">3.3. Augmented Certificate</a>
    <li><a href="#ref-for-list①">3.5. Exchange Signature</a>
    <li><a href="#ref-for-list②">4.13. Request matching</a> <a href="#ref-for-list③">(2)</a> <a href="#ref-for-list④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-strictly-split">
   <a href="https://infra.spec.whatwg.org/#strictly-split">https://infra.spec.whatwg.org/#strictly-split</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-strictly-split">4.5. Parsing a Signature Header Field</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-struct">
   <a href="https://infra.spec.whatwg.org/#struct">https://infra.spec.whatwg.org/#struct</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-struct">3.1. Exchange</a>
    <li><a href="#ref-for-struct①">3.2. Read buffer</a>
    <li><a href="#ref-for-struct②">3.4. Signed Exchange report</a>
    <li><a href="#ref-for-struct③">3.5. Exchange Signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-tuple">
   <a href="https://infra.spec.whatwg.org/#tuple">https://infra.spec.whatwg.org/#tuple</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-tuple">3.3. Augmented Certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mime-type-essence">
   <a href="https://mimesniff.spec.whatwg.org/#mime-type-essence">https://mimesniff.spec.whatwg.org/#mime-type-essence</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mime-type-essence">4.1. Identifying signed exchanges</a>
    <li><a href="#ref-for-mime-type-essence①">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mime-type">
   <a href="https://mimesniff.spec.whatwg.org/#mime-type">https://mimesniff.spec.whatwg.org/#mime-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mime-type">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-parameters">
   <a href="https://mimesniff.spec.whatwg.org/#parameters">https://mimesniff.spec.whatwg.org/#parameters</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parameters">4.1. Identifying signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-deliver-a-network-report">
   <a href="https://w3c.github.io/network-error-logging/#deliver-a-network-report">https://w3c.github.io/network-error-logging/#deliver-a-network-report</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-deliver-a-network-report">4.16. Queuing signed exchange report</a> <a href="#ref-for-deliver-a-network-report①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-generate-a-network-error-report">
   <a href="https://w3c.github.io/network-error-logging/#generate-a-network-error-report">https://w3c.github.io/network-error-logging/#generate-a-network-error-report</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-generate-a-network-error-report">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-nel-policies">
   <a href="https://w3c.github.io/network-error-logging/#dfn-nel-policies">https://w3c.github.io/network-error-logging/#dfn-nel-policies</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-nel-policies">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-4.3.2">
   <a href="https://tools.ietf.org/html/rfc3230#section-4.3.2">https://tools.ietf.org/html/rfc3230#section-4.3.2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-4.3.2">4.12. Creating the response stream.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-4.1.1.2">
   <a href="https://tools.ietf.org/html/rfc5280#section-4.1.1.2">https://tools.ietf.org/html/rfc5280#section-4.1.1.2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-4.1.1.2">3.3. Augmented Certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-4.2">
   <a href="https://tools.ietf.org/html/rfc5280#section-4.2">https://tools.ietf.org/html/rfc5280#section-4.2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-4.2">3.3. Augmented Certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-4.1.2.7">
   <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.7">https://tools.ietf.org/html/rfc5280#section-4.1.2.7</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-4.1.2.7">3.3. Augmented Certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-2.1.1">
   <a href="https://tools.ietf.org/html/rfc5480#section-2.1.1">https://tools.ietf.org/html/rfc5480#section-2.1.1</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-2.1.1">4.7. Validating a signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-2.1.1.1">
   <a href="https://tools.ietf.org/html/rfc5480#section-2.1.1.1">https://tools.ietf.org/html/rfc5480#section-2.1.1.1</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-2.1.1.1">4.7. Validating a signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-4.2.1">
   <a href="https://tools.ietf.org/html/rfc6960#section-4.2.1">https://tools.ietf.org/html/rfc6960#section-4.2.1</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-4.2.1">3.3. Augmented Certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-3.3">
   <a href="https://tools.ietf.org/html/rfc6962#section-3.3">https://tools.ietf.org/html/rfc6962#section-3.3</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-3.3">3.3. Augmented Certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-7.1.1.2">
   <a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2">https://tools.ietf.org/html/rfc7231#section-7.1.1.2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-7.1.1.2">2.3. Response date</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-4.2.3">
   <a href="https://tools.ietf.org/html/draft-ietf-tls-tls13-28#section-4.2.3">https://tools.ietf.org/html/draft-ietf-tls-tls13-28#section-4.2.3</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-4.2.3">4.7. Validating a signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-potentially-trustworthy-origin">
   <a href="https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-origin">https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-potentially-trustworthy-origin">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fetchevent">
   <a href="https://w3c.github.io/ServiceWorker/#fetchevent">https://w3c.github.io/ServiceWorker/#fetchevent</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetchevent">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-serviceworkerregistration-navigationpreload">
   <a href="https://w3c.github.io/ServiceWorker/#dom-serviceworkerregistration-navigationpreload">https://w3c.github.io/ServiceWorker/#dom-serviceworkerregistration-navigationpreload</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceworkerregistration-navigationpreload">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-fetchevent-preloadresponse">
   <a href="https://w3c.github.io/ServiceWorker/#dom-fetchevent-preloadresponse">https://w3c.github.io/ServiceWorker/#dom-fetchevent-preloadresponse</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-fetchevent-preloadresponse">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-fetchevent-request">
   <a href="https://w3c.github.io/ServiceWorker/#dom-fetchevent-request">https://w3c.github.io/ServiceWorker/#dom-fetchevent-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-fetchevent-request">1.1. Overview</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#">http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">3.5. Exchange Signature</a>
    <li><a href="#termref-for-">4.5.1. Handling the certificate reference</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-rs-class">
   <a href="https://streams.spec.whatwg.org/#rs-class">https://streams.spec.whatwg.org/#rs-class</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-rs-class">3.2. Read buffer</a>
    <li><a href="#ref-for-rs-class①">4.17. Stream algorithms</a>
    <li><a href="#ref-for-rs-class②">4.17.1. Create a read buffer</a>
    <li><a href="#ref-for-rs-class③">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-default-reader-class">
   <a href="https://streams.spec.whatwg.org/#default-reader-class">https://streams.spec.whatwg.org/#default-reader-class</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-default-reader-class">3.2. Read buffer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-equals">
   <a href="https://url.spec.whatwg.org/#concept-url-equals">https://url.spec.whatwg.org/#concept-url-equals</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-equals">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-fragment">
   <a href="https://url.spec.whatwg.org/#concept-url-fragment">https://url.spec.whatwg.org/#concept-url-fragment</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-fragment">4.4. Parsing the invariant prefix</a>
    <li><a href="#ref-for-concept-url-fragment①">4.5. Parsing a Signature Header Field</a> <a href="#ref-for-concept-url-fragment②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-origin">
   <a href="https://url.spec.whatwg.org/#concept-url-origin">https://url.spec.whatwg.org/#concept-url-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-origin">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-concept-url-origin①">4.8. Cross-origin trust</a> <a href="#ref-for-concept-url-origin②">(2)</a> <a href="#ref-for-concept-url-origin③">(3)</a>
    <li><a href="#ref-for-concept-url-origin④">4.16. Queuing signed exchange report</a> <a href="#ref-for-concept-url-origin⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-scheme">
   <a href="https://url.spec.whatwg.org/#concept-url-scheme">https://url.spec.whatwg.org/#concept-url-scheme</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-scheme">4.4. Parsing the invariant prefix</a>
    <li><a href="#ref-for-concept-url-scheme①">4.5. Parsing a Signature Header Field</a> <a href="#ref-for-concept-url-scheme②">(2)</a>
    <li><a href="#ref-for-concept-url-scheme③">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url">
   <a href="https://url.spec.whatwg.org/#concept-url">https://url.spec.whatwg.org/#concept-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url">3.1. Exchange</a>
    <li><a href="#ref-for-concept-url①">3.4. Signed Exchange report</a> <a href="#ref-for-concept-url②">(2)</a>
    <li><a href="#ref-for-concept-url③">3.5. Exchange Signature</a>
    <li><a href="#ref-for-concept-url④">4.4. Parsing the invariant prefix</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-parser">
   <a href="https://url.spec.whatwg.org/#concept-url-parser">https://url.spec.whatwg.org/#concept-url-parser</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-parser">4.4. Parsing the invariant prefix</a>
    <li><a href="#ref-for-concept-url-parser①">4.5. Parsing a Signature Header Field</a> <a href="#ref-for-concept-url-parser②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-serializer">
   <a href="https://url.spec.whatwg.org/#concept-url-serializer">https://url.spec.whatwg.org/#concept-url-serializer</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-serializer">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-concept-url-serializer①">4.16. Queuing signed exchange report</a> <a href="#ref-for-concept-url-serializer②">(2)</a> <a href="#ref-for-concept-url-serializer③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-ArrayBuffer">
   <a href="https://heycam.github.io/webidl/#idl-ArrayBuffer">https://heycam.github.io/webidl/#idl-ArrayBuffer</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-ArrayBuffer">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-Uint8Array">
   <a href="https://heycam.github.io/webidl/#idl-Uint8Array">https://heycam.github.io/webidl/#idl-Uint8Array</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-Uint8Array">4.17.2. Read up to bytes</a> <a href="#ref-for-idl-Uint8Array①">(2)</a>
    <li><a href="#ref-for-idl-Uint8Array②">4.17.4. Dump to another stream</a> <a href="#ref-for-idl-Uint8Array③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sequence-type">
   <a href="https://heycam.github.io/webidl/#sequence-type">https://heycam.github.io/webidl/#sequence-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sequence-type">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[draft-ietf-httpbis-header-structure]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-4.2" style="color:initial">parsing http1 header fields into structured headers</span>
    </ul>
   <li>
    <a data-link-type="biblio">[draft-ietf-httpbis-variants]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-variant-key" style="color:initial">variant-key</span>
     <li><span class="dfn-paneled" id="term-for-variants" style="color:initial">variants</span>
     <li><span class="dfn-paneled" id="term-for-cache" style="color:initial">variants cache behavior</span>
    </ul>
   <li>
    <a data-link-type="biblio">[draft-thomson-http-mice]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-2.2" style="color:initial">integrity proof for the first record</span>
    </ul>
   <li>
    <a data-link-type="biblio">[draft-yasskin-http-origin-signed-responses]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-seccons-off-path" style="color:initial">off-path attackers</span>
     <li><span class="dfn-paneled" id="term-for-uncached-headers" style="color:initial">uncached response header</span>
    </ul>
   <li>
    <a data-link-type="biblio">[draft-yasskin-httpbis-origin-signed-exchanges-impl-02]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-3.4" style="color:initial">canonically-encoded cbor</span>
     <li><span class="dfn-paneled" id="term-for-section-4.2①" style="color:initial">cansignhttpexchanges</span>
     <li><span class="dfn-paneled" id="term-for-section-3.3" style="color:initial">cert-chain cddl</span>
    </ul>
   <li>
    <a data-link-type="biblio">[draft-yasskin-wpack-bundled-exchanges]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-parse-known-length" style="color:initial">parsing a cbor item</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ENCODING]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-utf-8-decode-without-bom-or-fail" style="color:initial">utf-8 decode without bom or fail</span>
    </ul>
   <li>
    <a data-link-type="biblio">[FETCH]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dom-requestcache-only-if-cached" style="color:initial">"only-if-cached"</span>
     <li><span class="dfn-paneled" id="term-for-request" style="color:initial">Request</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-list-append" style="color:initial">append</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-body" style="color:initial">body <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-dom-request-cache" style="color:initial">cache</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-cache-mode" style="color:initial">cache mode</span>
     <li><span class="dfn-paneled" id="term-for-concept-cancel-readablestream" style="color:initial">cancel</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-client" style="color:initial">client</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-clone" style="color:initial">clone <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-dom-request-clone" style="color:initial">clone()</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream-closed" style="color:initial">closed</span>
     <li><span class="dfn-paneled" id="term-for-concept-construct-readablestream" style="color:initial">construct a readablestream object</span>
     <li><span class="dfn-paneled" id="term-for-header-list-contains" style="color:initial">contains</span>
     <li><span class="dfn-paneled" id="term-for-determine-nosniff" style="color:initial">determine nosniff</span>
     <li><span class="dfn-paneled" id="term-for-header-list-contains①" style="color:initial">does not contain</span>
     <li><span class="dfn-paneled" id="term-for-concept-enqueue-readablestream" style="color:initial">enqueue</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream-errored" style="color:initial">errored</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-extract-mime-type" style="color:initial">extracting a mime type</span>
     <li><span class="dfn-paneled" id="term-for-extract-header-list-values" style="color:initial">extracting header list values</span>
     <li><span class="dfn-paneled" id="term-for-concept-fetch" style="color:initial">fetch</span>
     <li><span class="dfn-paneled" id="term-for-dom-global-fetch" style="color:initial">fetch(input)</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-list-get" style="color:initial">get</span>
     <li><span class="dfn-paneled" id="term-for-concept-get-reader" style="color:initial">get a reader</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-list-get-decode-split" style="color:initial">getting, decoding, and splitting</span>
     <li><span class="dfn-paneled" id="term-for-handle-content-codings" style="color:initial">handle content codings</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-header-list" style="color:initial">header list <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-concept-http-fetch" style="color:initial">http fetch</span>
     <li><span class="dfn-paneled" id="term-for-concept-http-network-fetch" style="color:initial">http-network fetch</span>
     <li><span class="dfn-paneled" id="term-for-concept-http-network-or-cache-fetch" style="color:initial">http-network-or-cache fetch</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-https-state" style="color:initial">https state</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-initiator" style="color:initial">initiator</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-method" style="color:initial">method</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-mode" style="color:initial">mode</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-name" style="color:initial">name</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream-need-more-data" style="color:initial">need more data</span>
     <li><span class="dfn-paneled" id="term-for-concept-network-error" style="color:initial">network error</span>
     <li><span class="dfn-paneled" id="term-for-concept-read-chunk-from-readablestream" style="color:initial">read a chunk</span>
     <li><span class="dfn-paneled" id="term-for-concept-read-all-bytes-from-readablestream" style="color:initial">read all bytes</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream-readable" style="color:initial">readable</span>
     <li><span class="dfn-paneled" id="term-for-redirect-status" style="color:initial">redirect status</span>
     <li><span class="dfn-paneled" id="term-for-concept-request" style="color:initial">request</span>
     <li><span class="dfn-paneled" id="term-for-concept-response" style="color:initial">response</span>
     <li><span class="dfn-paneled" id="term-for-request-service-workers-mode" style="color:initial">service-workers mode</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-list-set" style="color:initial">set</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-status" style="color:initial">status <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-concept-body-stream" style="color:initial">stream</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-url" style="color:initial">url <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-concept-header-value" style="color:initial">value</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-environment-settings-object" style="color:initial">environment settings object</span>
     <li><span class="dfn-paneled" id="term-for-concept-origin-host" style="color:initial">host</span>
     <li><span class="dfn-paneled" id="term-for-in-parallel" style="color:initial">in parallel</span>
     <li><span class="dfn-paneled" id="term-for-concept-origin" style="color:initial">origin</span>
     <li><span class="dfn-paneled" id="term-for-same-origin" style="color:initial">same origin</span>
    </ul>
   <li>
    <a data-link-type="biblio">[http-dig-alg]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-http-dig-alg-1" style="color:initial">digest algorithm</span>
    </ul>
   <li>
    <a data-link-type="biblio">[INFRA]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-ascii-byte" style="color:initial">ascii byte</span>
     <li><span class="dfn-paneled" id="term-for-ascii-decode" style="color:initial">ascii decode</span>
     <li><span class="dfn-paneled" id="term-for-ascii-encode" style="color:initial">ascii encode</span>
     <li><span class="dfn-paneled" id="term-for-ascii-string" style="color:initial">ascii string</span>
     <li><span class="dfn-paneled" id="term-for-ascii-upper-alpha" style="color:initial">ascii upper alpha</span>
     <li><span class="dfn-paneled" id="term-for-byte-sequence" style="color:initial">byte sequence</span>
     <li><span class="dfn-paneled" id="term-for-list-empty" style="color:initial">empty</span>
     <li><span class="dfn-paneled" id="term-for-set-intersection" style="color:initial">intersection</span>
     <li><span class="dfn-paneled" id="term-for-isomorphic-decode" style="color:initial">isomorphic decode</span>
     <li><span class="dfn-paneled" id="term-for-list-item" style="color:initial">item</span>
     <li><span class="dfn-paneled" id="term-for-list" style="color:initial">list</span>
     <li><span class="dfn-paneled" id="term-for-strictly-split" style="color:initial">strictly split</span>
     <li><span class="dfn-paneled" id="term-for-struct" style="color:initial">struct</span>
     <li><span class="dfn-paneled" id="term-for-tuple" style="color:initial">tuple</span>
    </ul>
   <li>
    <a data-link-type="biblio">[MIMESNIFF]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-mime-type-essence" style="color:initial">essence</span>
     <li><span class="dfn-paneled" id="term-for-mime-type" style="color:initial">mime type</span>
     <li><span class="dfn-paneled" id="term-for-parameters" style="color:initial">parameters</span>
    </ul>
   <li>
    <a data-link-type="biblio">[network-error-logging-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-deliver-a-network-report" style="color:initial">deliver a network report</span>
     <li><span class="dfn-paneled" id="term-for-generate-a-network-error-report" style="color:initial">generate a network error report</span>
     <li><span class="dfn-paneled" id="term-for-dfn-nel-policies" style="color:initial">nel policy</span>
    </ul>
   <li>
    <a data-link-type="biblio">[rfc3230]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-4.3.2" style="color:initial">digest</span>
    </ul>
   <li>
    <a data-link-type="biblio">[RFC5280]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-4.1.1.2" style="color:initial">algorithmidentifier</span>
     <li><span class="dfn-paneled" id="term-for-section-4.2②" style="color:initial">certificate extensions</span>
     <li><span class="dfn-paneled" id="term-for-section-4.1.2.7" style="color:initial">subject public key info</span>
    </ul>
   <li>
    <a data-link-type="biblio">[rfc5480]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-2.1.1" style="color:initial">id-ecpublickey</span>
     <li><span class="dfn-paneled" id="term-for-section-2.1.1.1" style="color:initial">secp256r1</span>
    </ul>
   <li>
    <a data-link-type="biblio">[rfc6960]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-4.2.1" style="color:initial">ocspresponse</span>
    </ul>
   <li>
    <a data-link-type="biblio">[RFC6962]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-3.3①" style="color:initial">signedcertificatetimestamplist</span>
    </ul>
   <li>
    <a data-link-type="biblio">[rfc7231]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-7.1.1.2" style="color:initial">date</span>
    </ul>
   <li>
    <a data-link-type="biblio">[RFC8446]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-4.2.3" style="color:initial">ecdsa_secp256r1_sha256</span>
    </ul>
   <li>
    <a data-link-type="biblio">[secure-contexts]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-potentially-trustworthy-origin" style="color:initial">potentially trustworthy origin</span>
    </ul>
   <li>
    <a data-link-type="biblio">[service-workers-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-fetchevent" style="color:initial">FetchEvent</span>
     <li><span class="dfn-paneled" id="term-for-dom-serviceworkerregistration-navigationpreload" style="color:initial">navigationPreload</span>
     <li><span class="dfn-paneled" id="term-for-dom-fetchevent-preloadresponse" style="color:initial">preloadResponse</span>
     <li><span class="dfn-paneled" id="term-for-dom-fetchevent-request" style="color:initial">request</span>
    </ul>
   <li>
    <a data-link-type="biblio">[SHA2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-" style="color:initial">sha-256</span>
    </ul>
   <li>
    <a data-link-type="biblio">[STREAMS]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-rs-class" style="color:initial">ReadableStream</span>
     <li><span class="dfn-paneled" id="term-for-default-reader-class" style="color:initial">ReadableStreamDefaultReader</span>
    </ul>
   <li>
    <a data-link-type="biblio">[URL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-concept-url-equals" style="color:initial">equal</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-fragment" style="color:initial">fragment</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-origin" style="color:initial">origin</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-scheme" style="color:initial">scheme</span>
     <li><span class="dfn-paneled" id="term-for-concept-url" style="color:initial">url</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-parser" style="color:initial">url parser</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-serializer" style="color:initial">url serializer</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-idl-ArrayBuffer" style="color:initial">ArrayBuffer</span>
     <li><span class="dfn-paneled" id="term-for-idl-Uint8Array" style="color:initial">Uint8Array</span>
     <li><span class="dfn-paneled" id="term-for-sequence-type" style="color:initial">sequence type</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-draft-ietf-httpbis-variants">[DRAFT-IETF-HTTPBIS-VARIANTS]
   <dd>Mark Nottingham. <a href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html">HTTP Representation Variants</a>. WD. URL: <a href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html">https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html</a>
   <dt id="biblio-draft-thomson-http-mice">[DRAFT-THOMSON-HTTP-MICE]
   <dd>Martin Thomson. <a href="https://tools.ietf.org/html/draft-thomson-http-mice-03">Merkle Integrity Content Encoding</a>. ED. URL: <a href="https://tools.ietf.org/html/draft-thomson-http-mice-03">https://tools.ietf.org/html/draft-thomson-http-mice-03</a>
   <dt id="biblio-draft-yasskin-http-origin-signed-responses">[DRAFT-YASSKIN-HTTP-ORIGIN-SIGNED-RESPONSES]
   <dd>Jeffrey Yasskin. <a href="https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html">Signed HTTP Exchanges</a>. ED. URL: <a href="https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html">https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html</a>
   <dt id="biblio-draft-yasskin-httpbis-origin-signed-exchanges-impl-02">[DRAFT-YASSKIN-HTTPBIS-ORIGIN-SIGNED-EXCHANGES-IMPL-02]
   <dd>Jeffrey Yasskin; Kouhei Ueno. <a href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02">Signed HTTP Exchanges Implementation Checkpoints</a>. ED. URL: <a href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02">https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-02</a>
   <dt id="biblio-draft-yasskin-wpack-bundled-exchanges">[DRAFT-YASSKIN-WPACK-BUNDLED-EXCHANGES]
   <dd>Jeffrey Yasskin. <a href="https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html">Web Bundles</a>. ED. URL: <a href="https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html">https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html</a>
   <dt id="biblio-encoding">[ENCODING]
   <dd>Anne van Kesteren. <a href="https://encoding.spec.whatwg.org/">Encoding Standard</a>. Living Standard. URL: <a href="https://encoding.spec.whatwg.org/">https://encoding.spec.whatwg.org/</a>
   <dt id="biblio-fetch">[FETCH]
   <dd>Anne van Kesteren. <a href="https://fetch.spec.whatwg.org/">Fetch Standard</a>. Living Standard. URL: <a href="https://fetch.spec.whatwg.org/">https://fetch.spec.whatwg.org/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-infra">[INFRA]
   <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/">Infra Standard</a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
   <dt id="biblio-mimesniff">[MIMESNIFF]
   <dd>Gordon P. Hemsley. <a href="https://mimesniff.spec.whatwg.org/">MIME Sniffing Standard</a>. Living Standard. URL: <a href="https://mimesniff.spec.whatwg.org/">https://mimesniff.spec.whatwg.org/</a>
   <dt id="biblio-network-error-logging-1">[NETWORK-ERROR-LOGGING-1]
   <dd>Douglas Creager; et al. <a href="https://www.w3.org/TR/network-error-logging-1/">Network Error Logging</a>. 25 September 2018. WD. URL: <a href="https://www.w3.org/TR/network-error-logging-1/">https://www.w3.org/TR/network-error-logging-1/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-rfc5280">[RFC5280]
   <dd>D. Cooper; et al. <a href="https://tools.ietf.org/html/rfc5280">Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile</a>. May 2008. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc5280">https://tools.ietf.org/html/rfc5280</a>
   <dt id="biblio-rfc5480">[RFC5480]
   <dd>S. Turner; et al. <a href="https://tools.ietf.org/html/rfc5480">Elliptic Curve Cryptography Subject Public Key Information</a>. March 2009. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc5480">https://tools.ietf.org/html/rfc5480</a>
   <dt id="biblio-rfc6960">[RFC6960]
   <dd>S. Santesson; et al. <a href="https://tools.ietf.org/html/rfc6960">X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP</a>. June 2013. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc6960">https://tools.ietf.org/html/rfc6960</a>
   <dt id="biblio-rfc6962">[RFC6962]
   <dd>B. Laurie; A. Langley; E. Kasper. <a href="https://tools.ietf.org/html/rfc6962">Certificate Transparency</a>. June 2013. Experimental. URL: <a href="https://tools.ietf.org/html/rfc6962">https://tools.ietf.org/html/rfc6962</a>
   <dt id="biblio-rfc7231">[RFC7231]
   <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href="https://httpwg.org/specs/rfc7231.html">Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</a>. June 2014. Proposed Standard. URL: <a href="https://httpwg.org/specs/rfc7231.html">https://httpwg.org/specs/rfc7231.html</a>
   <dt id="biblio-rfc8446">[RFC8446]
   <dd>E. Rescorla. <a href="https://tools.ietf.org/html/draft-ietf-tls-tls13">The Transport Layer Security (TLS) Protocol Version 1.3</a>. WD. URL: <a href="https://tools.ietf.org/html/draft-ietf-tls-tls13">https://tools.ietf.org/html/draft-ietf-tls-tls13</a>
   <dt id="biblio-secure-contexts">[SECURE-CONTEXTS]
   <dd>Mike West. <a href="https://www.w3.org/TR/secure-contexts/">Secure Contexts</a>. 15 September 2016. CR. URL: <a href="https://www.w3.org/TR/secure-contexts/">https://www.w3.org/TR/secure-contexts/</a>
   <dt id="biblio-sha2">[SHA2]
   <dd><a href="http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf">FIPS PUB 180-4, Secure Hash Standard</a>. URL: <a href="http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf">http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf</a>
   <dt id="biblio-streams">[STREAMS]
   <dd>Adam Rice; Domenic Denicola; 吉野剛史 (Takeshi Yoshino). <a href="https://streams.spec.whatwg.org/">Streams Standard</a>. Living Standard. URL: <a href="https://streams.spec.whatwg.org/">https://streams.spec.whatwg.org/</a>
   <dt id="biblio-url">[URL]
   <dd>Anne van Kesteren. <a href="https://url.spec.whatwg.org/">URL Standard</a>. Living Standard. URL: <a href="https://url.spec.whatwg.org/">https://url.spec.whatwg.org/</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-draft-yasskin-httpbis-origin-signed-exchanges-impl-03">[DRAFT-YASSKIN-HTTPBIS-ORIGIN-SIGNED-EXCHANGES-IMPL-03]
   <dd>Jeffrey Yasskin; Kouhei Ueno. <a href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-03">Signed HTTP Exchanges Implementation Checkpoints</a>. ED. URL: <a href="https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-03">https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-03</a>
   <dt id="biblio-http-dig-alg">[HTTP-DIG-ALG]
   <dd><a href="https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml">Hypertext Transfer Protocol (HTTP) Digest Algorithm Values</a>. LS. URL: <a href="https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml">https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml</a>
   <dt id="biblio-rfc3230">[RFC3230]
   <dd>J. Mogul; A. Van Hoff. <a href="https://tools.ietf.org/html/rfc3230">Instance Digests in HTTP</a>. January 2002. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc3230">https://tools.ietf.org/html/rfc3230</a>
   <dt id="biblio-service-workers-1">[SERVICE-WORKERS-1]
   <dd>Alex Russell; et al. <a href="https://www.w3.org/TR/service-workers-1/">Service Workers 1</a>. 2 November 2017. WD. URL: <a href="https://www.w3.org/TR/service-workers-1/">https://www.w3.org/TR/service-workers-1/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> Our security reviewers aren’t sure we should
allow UAs to take clock skew into account. <a href="https://github.com/WICG/webpackage/issues/141">&lt;https://github.com/WICG/webpackage/issues/141></a><a href="#issue-a7ea6416"> ↵ </a></div>
   <div class="issue"> This depends on the <a data-link-type="dfn" href="https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#cache">Variants Cache
Behavior</a> returning a list of lists. <a href="https://github.com/httpwg/http-extensions/issues/744">&lt;https://github.com/httpwg/http-extensions/issues/744></a><a href="#issue-e1733bef"> ↵ </a></div>
   <div class="issue"> The algorithms in this section create and operate over
ECMAScript objects like <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#rs-class">ReadableStream</a></code> despite not having a Realm to attach
them to. <a href="https://github.com/whatwg/fetch/issues/730">&lt;https://github.com/whatwg/fetch/issues/730></a><a href="#issue-3ffca592"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="request-stashed-exchange">
   <b><a href="#request-stashed-exchange">#request-stashed-exchange</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-stashed-exchange">2.2. Request clone</a> <a href="#ref-for-request-stashed-exchange①">(2)</a> <a href="#ref-for-request-stashed-exchange②">(3)</a> <a href="#ref-for-request-stashed-exchange③">(4)</a> <a href="#ref-for-request-stashed-exchange④">(5)</a>
    <li><a href="#ref-for-request-stashed-exchange⑤">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-request-stashed-exchange⑥">2.5. Monkeypatch HTTP-network-or-cache fetch</a> <a href="#ref-for-request-stashed-exchange⑦">(2)</a> <a href="#ref-for-request-stashed-exchange⑧">(3)</a> <a href="#ref-for-request-stashed-exchange⑨">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="response-date">
   <b><a href="#response-date">#response-date</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-response-date">2.5. Monkeypatch HTTP-network-or-cache fetch</a> <a href="#ref-for-response-date①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange">
   <b><a href="#exchange">#exchange</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange">2.1. A request’s stashed exchange</a>
    <li><a href="#ref-for-exchange①">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-exchange②">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-exchange③">4.8. Cross-origin trust</a>
    <li><a href="#ref-for-exchange④">4.10. Parsing b2 CBOR headers</a> <a href="#ref-for-exchange⑤">(2)</a>
    <li><a href="#ref-for-exchange⑥">4.11. Parsing b3 CBOR headers</a> <a href="#ref-for-exchange⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-request-url">
   <b><a href="#exchange-request-url">#exchange-request-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-request-url">2.2. Request clone</a> <a href="#ref-for-exchange-request-url①">(2)</a>
    <li><a href="#ref-for-exchange-request-url②">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-exchange-request-url③">4.8. Cross-origin trust</a>
    <li><a href="#ref-for-exchange-request-url④">4.13. Request matching</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-response">
   <b><a href="#exchange-response">#exchange-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-response">2.2. Request clone</a> <a href="#ref-for-exchange-response①">(2)</a>
    <li><a href="#ref-for-exchange-response②">2.5. Monkeypatch HTTP-network-or-cache fetch</a> <a href="#ref-for-exchange-response③">(2)</a>
    <li><a href="#ref-for-exchange-response④">4.3. Parsing signed exchanges</a> <a href="#ref-for-exchange-response⑤">(2)</a> <a href="#ref-for-exchange-response⑥">(3)</a> <a href="#ref-for-exchange-response⑦">(4)</a>
    <li><a href="#ref-for-exchange-response⑧">4.8. Cross-origin trust</a>
    <li><a href="#ref-for-exchange-response⑨">4.13. Request matching</a> <a href="#ref-for-exchange-response①⓪">(2)</a> <a href="#ref-for-exchange-response①①">(3)</a> <a href="#ref-for-exchange-response①②">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-buffer">
   <b><a href="#read-buffer">#read-buffer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-buffer">4.4. Parsing the invariant prefix</a>
    <li><a href="#ref-for-read-buffer①">4.12. Creating the response stream.</a>
    <li><a href="#ref-for-read-buffer②">4.17.1. Create a read buffer</a>
    <li><a href="#ref-for-read-buffer③">4.17.2. Read up to bytes</a>
    <li><a href="#ref-for-read-buffer④">4.17.3. Read bytes</a>
    <li><a href="#ref-for-read-buffer⑤">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-buffer-stream">
   <b><a href="#read-buffer-stream">#read-buffer-stream</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-buffer-stream">3.2. Read buffer</a> <a href="#ref-for-read-buffer-stream①">(2)</a>
    <li><a href="#ref-for-read-buffer-stream②">4.12. Creating the response stream.</a>
    <li><a href="#ref-for-read-buffer-stream③">4.17.1. Create a read buffer</a>
    <li><a href="#ref-for-read-buffer-stream④">4.17.4. Dump to another stream</a> <a href="#ref-for-read-buffer-stream⑤">(2)</a> <a href="#ref-for-read-buffer-stream⑥">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-buffer-reader">
   <b><a href="#read-buffer-reader">#read-buffer-reader</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-buffer-reader">4.17.1. Create a read buffer</a>
    <li><a href="#ref-for-read-buffer-reader①">4.17.2. Read up to bytes</a>
    <li><a href="#ref-for-read-buffer-reader②">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-buffer-bytes">
   <b><a href="#read-buffer-bytes">#read-buffer-bytes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-buffer-bytes">4.17.1. Create a read buffer</a>
    <li><a href="#ref-for-read-buffer-bytes①">4.17.2. Read up to bytes</a> <a href="#ref-for-read-buffer-bytes②">(2)</a> <a href="#ref-for-read-buffer-bytes③">(3)</a> <a href="#ref-for-read-buffer-bytes④">(4)</a> <a href="#ref-for-read-buffer-bytes⑤">(5)</a> <a href="#ref-for-read-buffer-bytes⑥">(6)</a>
    <li><a href="#ref-for-read-buffer-bytes⑦">4.17.4. Dump to another stream</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="augmented-certificate">
   <b><a href="#augmented-certificate">#augmented-certificate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-augmented-certificate">3.3. Augmented Certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="augmented-certificate-certificate">
   <b><a href="#augmented-certificate-certificate">#augmented-certificate-certificate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-augmented-certificate-certificate">3.3. Augmented Certificate</a> <a href="#ref-for-augmented-certificate-certificate①">(2)</a> <a href="#ref-for-augmented-certificate-certificate②">(3)</a> <a href="#ref-for-augmented-certificate-certificate③">(4)</a>
    <li><a href="#ref-for-augmented-certificate-certificate④">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-augmented-certificate-certificate⑤">4.9. Establishing trust in a certificate</a> <a href="#ref-for-augmented-certificate-certificate⑥">(2)</a> <a href="#ref-for-augmented-certificate-certificate⑦">(3)</a> <a href="#ref-for-augmented-certificate-certificate⑧">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="augmented-certificate-ocsp-response">
   <b><a href="#augmented-certificate-ocsp-response">#augmented-certificate-ocsp-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-augmented-certificate-ocsp-response">4.9. Establishing trust in a certificate</a> <a href="#ref-for-augmented-certificate-ocsp-response①">(2)</a> <a href="#ref-for-augmented-certificate-ocsp-response②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="augmented-certificate-sct">
   <b><a href="#augmented-certificate-sct">#augmented-certificate-sct</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-augmented-certificate-sct">4.9. Establishing trust in a certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="certificate-public-key">
   <b><a href="#certificate-public-key">#certificate-public-key</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-certificate-public-key">3.5. Exchange Signature</a>
    <li><a href="#ref-for-certificate-public-key①">4.7. Validating a signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="public-key-algorithm">
   <b><a href="#public-key-algorithm">#public-key-algorithm</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-public-key-algorithm">4.7. Validating a signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="certificate-extensions">
   <b><a href="#certificate-extensions">#certificate-extensions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-certificate-extensions">4.9. Establishing trust in a certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="certificate-chain">
   <b><a href="#certificate-chain">#certificate-chain</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-certificate-chain">3.5. Exchange Signature</a>
    <li><a href="#ref-for-certificate-chain①">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-certificate-chain②">4.5.1. Handling the certificate reference</a> <a href="#ref-for-certificate-chain③">(2)</a>
    <li><a href="#ref-for-certificate-chain④">4.9. Establishing trust in a certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="certificate-chain-leaf">
   <b><a href="#certificate-chain-leaf">#certificate-chain-leaf</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-certificate-chain-leaf">3.5. Exchange Signature</a> <a href="#ref-for-certificate-chain-leaf①">(2)</a> <a href="#ref-for-certificate-chain-leaf②">(3)</a>
    <li><a href="#ref-for-certificate-chain-leaf③">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-certificate-chain-leaf④">4.7. Validating a signature</a>
    <li><a href="#ref-for-certificate-chain-leaf⑤">4.9. Establishing trust in a certificate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report">
   <b><a href="#signed-exchange-report">#signed-exchange-report</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-signed-exchange-report①">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-signed-exchange-report②">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-signed-exchange-report③">4.14. Create a new signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-result">
   <b><a href="#signed-exchange-report-result">#signed-exchange-report-result</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-result">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-signed-exchange-report-result①">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-signed-exchange-report-result②">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-signed-exchange-report-result③">4.16. Queuing signed exchange report</a> <a href="#ref-for-signed-exchange-report-result④">(2)</a> <a href="#ref-for-signed-exchange-report-result⑤">(3)</a> <a href="#ref-for-signed-exchange-report-result⑥">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-ok">
   <b><a href="#signed-exchange-report-ok">#signed-exchange-report-ok</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-ok">4.15. Wait and queue a report</a>
    <li><a href="#ref-for-signed-exchange-report-ok①">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-mi_error">
   <b><a href="#signed-exchange-report-mi_error">#signed-exchange-report-mi_error</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-mi_error">4.15. Wait and queue a report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-non_secure_distributor">
   <b><a href="#signed-exchange-report-non_secure_distributor">#signed-exchange-report-non_secure_distributor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-non_secure_distributor">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-parse_error">
   <b><a href="#signed-exchange-report-parse_error">#signed-exchange-report-parse_error</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-parse_error">4.3. Parsing signed exchanges</a> <a href="#ref-for-signed-exchange-report-parse_error①">(2)</a> <a href="#ref-for-signed-exchange-report-parse_error②">(3)</a> <a href="#ref-for-signed-exchange-report-parse_error③">(4)</a> <a href="#ref-for-signed-exchange-report-parse_error④">(5)</a> <a href="#ref-for-signed-exchange-report-parse_error⑤">(6)</a> <a href="#ref-for-signed-exchange-report-parse_error⑥">(7)</a> <a href="#ref-for-signed-exchange-report-parse_error⑦">(8)</a>
    <li><a href="#ref-for-signed-exchange-report-parse_error⑧">4.5. Parsing a Signature Header Field</a> <a href="#ref-for-signed-exchange-report-parse_error⑨">(2)</a> <a href="#ref-for-signed-exchange-report-parse_error①⓪">(3)</a> <a href="#ref-for-signed-exchange-report-parse_error①①">(4)</a> <a href="#ref-for-signed-exchange-report-parse_error①②">(5)</a> <a href="#ref-for-signed-exchange-report-parse_error①③">(6)</a> <a href="#ref-for-signed-exchange-report-parse_error①④">(7)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-invalid_integrity_header">
   <b><a href="#signed-exchange-report-invalid_integrity_header">#signed-exchange-report-invalid_integrity_header</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-invalid_integrity_header">4.12. Creating the response stream.</a> <a href="#ref-for-signed-exchange-report-invalid_integrity_header①">(2)</a> <a href="#ref-for-signed-exchange-report-invalid_integrity_header②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-signature_verification_error">
   <b><a href="#signed-exchange-report-signature_verification_error">#signed-exchange-report-signature_verification_error</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-signature_verification_error">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-signed-exchange-report-signature_verification_error①">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-signed-exchange-report-signature_verification_error②">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-cert_verification_error">
   <b><a href="#signed-exchange-report-cert_verification_error">#signed-exchange-report-cert_verification_error</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-cert_verification_error">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-signed-exchange-report-cert_verification_error①">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-cert_fetch_error">
   <b><a href="#signed-exchange-report-cert_fetch_error">#signed-exchange-report-cert_fetch_error</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-cert_fetch_error">4.5.1. Handling the certificate reference</a> <a href="#ref-for-signed-exchange-report-cert_fetch_error①">(2)</a>
    <li><a href="#ref-for-signed-exchange-report-cert_fetch_error②">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-cert_parse_error">
   <b><a href="#signed-exchange-report-cert_parse_error">#signed-exchange-report-cert_parse_error</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-cert_parse_error">4.5.1. Handling the certificate reference</a> <a href="#ref-for-signed-exchange-report-cert_parse_error①">(2)</a> <a href="#ref-for-signed-exchange-report-cert_parse_error②">(3)</a>
    <li><a href="#ref-for-signed-exchange-report-cert_parse_error③">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-outer-request">
   <b><a href="#signed-exchange-report-outer-request">#signed-exchange-report-outer-request</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-outer-request">4.14. Create a new signed exchange report</a>
    <li><a href="#ref-for-signed-exchange-report-outer-request①">4.16. Queuing signed exchange report</a> <a href="#ref-for-signed-exchange-report-outer-request②">(2)</a> <a href="#ref-for-signed-exchange-report-outer-request③">(3)</a> <a href="#ref-for-signed-exchange-report-outer-request④">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-outer-response">
   <b><a href="#signed-exchange-report-outer-response">#signed-exchange-report-outer-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-outer-response">4.14. Create a new signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-inner-url">
   <b><a href="#signed-exchange-report-inner-url">#signed-exchange-report-inner-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-inner-url">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-signed-exchange-report-inner-url①">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-cert-url-list">
   <b><a href="#signed-exchange-report-cert-url-list">#signed-exchange-report-cert-url-list</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-cert-url-list">3.4. Signed Exchange report</a>
    <li><a href="#ref-for-signed-exchange-report-cert-url-list①">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-signed-exchange-report-cert-url-list②">4.16. Queuing signed exchange report</a> <a href="#ref-for-signed-exchange-report-cert-url-list③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-server-ip">
   <b><a href="#signed-exchange-report-server-ip">#signed-exchange-report-server-ip</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-server-ip">4.14. Create a new signed exchange report</a>
    <li><a href="#ref-for-signed-exchange-report-server-ip①">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-report-cert-server-ip-list">
   <b><a href="#signed-exchange-report-cert-server-ip-list">#signed-exchange-report-cert-server-ip-list</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-report-cert-server-ip-list">4.5.1. Handling the certificate reference</a>
    <li><a href="#ref-for-signed-exchange-report-cert-server-ip-list①">4.16. Queuing signed exchange report</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature">
   <b><a href="#exchange-signature">#exchange-signature</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-exchange-signature①">4.5. Parsing a Signature Header Field</a> <a href="#ref-for-exchange-signature②">(2)</a>
    <li><a href="#ref-for-exchange-signature③">4.6. The signed message</a>
    <li><a href="#ref-for-exchange-signature④">4.7. Validating a signature</a>
    <li><a href="#ref-for-exchange-signature⑤">4.8. Cross-origin trust</a>
    <li><a href="#ref-for-exchange-signature⑥">4.12. Creating the response stream.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-signature">
   <b><a href="#exchange-signature-signature">#exchange-signature-signature</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-signature">3.5. Exchange Signature</a>
    <li><a href="#ref-for-exchange-signature-signature①">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-exchange-signature-signature②">4.7. Validating a signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-certificate-chain">
   <b><a href="#exchange-signature-certificate-chain">#exchange-signature-certificate-chain</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-certificate-chain">3.5. Exchange Signature</a>
    <li><a href="#ref-for-exchange-signature-certificate-chain①">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-exchange-signature-certificate-chain②">4.7. Validating a signature</a>
    <li><a href="#ref-for-exchange-signature-certificate-chain③">4.8. Cross-origin trust</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-certsha256">
   <b><a href="#exchange-signature-certsha256">#exchange-signature-certsha256</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-certsha256">4.5. Parsing a Signature Header Field</a> <a href="#ref-for-exchange-signature-certsha256①">(2)</a>
    <li><a href="#ref-for-exchange-signature-certsha256②">4.6. The signed message</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-integrity-header">
   <b><a href="#exchange-signature-integrity-header">#exchange-signature-integrity-header</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-integrity-header">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-exchange-signature-integrity-header①">4.12. Creating the response stream.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-validityurl">
   <b><a href="#exchange-signature-validityurl">#exchange-signature-validityurl</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-validityurl">3.5. Exchange Signature</a>
    <li><a href="#ref-for-exchange-signature-validityurl①">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-exchange-signature-validityurl②">4.8. Cross-origin trust</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-validityurlbytes">
   <b><a href="#exchange-signature-validityurlbytes">#exchange-signature-validityurlbytes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-validityurlbytes">4.5. Parsing a Signature Header Field</a>
    <li><a href="#ref-for-exchange-signature-validityurlbytes①">4.6. The signed message</a> <a href="#ref-for-exchange-signature-validityurlbytes②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-date">
   <b><a href="#exchange-signature-date">#exchange-signature-date</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-date">4.5. Parsing a Signature Header Field</a> <a href="#ref-for-exchange-signature-date①">(2)</a> <a href="#ref-for-exchange-signature-date②">(3)</a>
    <li><a href="#ref-for-exchange-signature-date③">4.6. The signed message</a>
    <li><a href="#ref-for-exchange-signature-date④">4.7. Validating a signature</a> <a href="#ref-for-exchange-signature-date⑤">(2)</a>
    <li><a href="#ref-for-exchange-signature-date⑥">4.8. Cross-origin trust</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-expiration-time">
   <b><a href="#exchange-signature-expiration-time">#exchange-signature-expiration-time</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-expiration-time">1.2. Other interesting details</a>
    <li><a href="#ref-for-exchange-signature-expiration-time①">4.5. Parsing a Signature Header Field</a> <a href="#ref-for-exchange-signature-expiration-time②">(2)</a> <a href="#ref-for-exchange-signature-expiration-time③">(3)</a>
    <li><a href="#ref-for-exchange-signature-expiration-time④">4.6. The signed message</a>
    <li><a href="#ref-for-exchange-signature-expiration-time⑤">4.7. Validating a signature</a> <a href="#ref-for-exchange-signature-expiration-time⑥">(2)</a>
    <li><a href="#ref-for-exchange-signature-expiration-time⑦">4.8. Cross-origin trust</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-exchange-version">
   <b><a href="#signed-exchange-version">#signed-exchange-version</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-exchange-version">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-signed-exchange-version①">4.2. Extracting the fallback URL</a>
    <li><a href="#ref-for-signed-exchange-version②">4.3. Parsing signed exchanges</a> <a href="#ref-for-signed-exchange-version③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extracting-the-fallback-url">
   <b><a href="#extracting-the-fallback-url">#extracting-the-fallback-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extracting-the-fallback-url">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-extracting-the-fallback-url①">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="parsing-a-signed-exchange">
   <b><a href="#parsing-a-signed-exchange">#parsing-a-signed-exchange</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parsing-a-signed-exchange">2.4. Monkeypatch HTTP fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="parsing-the-invariant-prefix">
   <b><a href="#parsing-the-invariant-prefix">#parsing-the-invariant-prefix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parsing-the-invariant-prefix">4.2. Extracting the fallback URL</a>
    <li><a href="#ref-for-parsing-the-invariant-prefix①">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="parsing-the-signature-header-field">
   <b><a href="#parsing-the-signature-header-field">#parsing-the-signature-header-field</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parsing-the-signature-header-field">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="handling-the-certificate-reference">
   <b><a href="#handling-the-certificate-reference">#handling-the-certificate-reference</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-handling-the-certificate-reference">4.5. Parsing a Signature Header Field</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="signed-message">
   <b><a href="#signed-message">#signed-message</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-signed-message">4.7. Validating a signature</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-is-valid">
   <b><a href="#exchange-signature-is-valid">#exchange-signature-is-valid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-is-valid">4.3. Parsing signed exchanges</a>
    <li><a href="#ref-for-exchange-signature-is-valid①">4.8. Cross-origin trust</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-signature-establishes-cross-origin-trust">
   <b><a href="#exchange-signature-establishes-cross-origin-trust">#exchange-signature-establishes-cross-origin-trust</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-signature-establishes-cross-origin-trust">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="certificate-chain-has-a-trusted-leaf">
   <b><a href="#certificate-chain-has-a-trusted-leaf">#certificate-chain-has-a-trusted-leaf</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-certificate-chain-has-a-trusted-leaf">4.8. Cross-origin trust</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="parsing-b2-cbor-headers">
   <b><a href="#parsing-b2-cbor-headers">#parsing-b2-cbor-headers</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parsing-b2-cbor-headers">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="parsing-b3-cbor-headers">
   <b><a href="#parsing-b3-cbor-headers">#parsing-b3-cbor-headers</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parsing-b3-cbor-headers">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="creating-a-header-list-from-the-cbor-map">
   <b><a href="#creating-a-header-list-from-the-cbor-map">#creating-a-header-list-from-the-cbor-map</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-creating-a-header-list-from-the-cbor-map">4.10. Parsing b2 CBOR headers</a> <a href="#ref-for-creating-a-header-list-from-the-cbor-map①">(2)</a>
    <li><a href="#ref-for-creating-a-header-list-from-the-cbor-map②">4.11. Parsing b3 CBOR headers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="reading-a-body">
   <b><a href="#reading-a-body">#reading-a-body</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reading-a-body">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="matches-the-stored-exchange">
   <b><a href="#matches-the-stored-exchange">#matches-the-stored-exchange</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-matches-the-stored-exchange">2.5. Monkeypatch HTTP-network-or-cache fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-new-signed-exchange-report">
   <b><a href="#create-a-new-signed-exchange-report">#create-a-new-signed-exchange-report</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-new-signed-exchange-report">2.4. Monkeypatch HTTP fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="wait-and-queue-a-report-for">
   <b><a href="#wait-and-queue-a-report-for">#wait-and-queue-a-report-for</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-wait-and-queue-a-report-for">2.4. Monkeypatch HTTP fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="queue-a-signed-exchange-report">
   <b><a href="#queue-a-signed-exchange-report">#queue-a-signed-exchange-report</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-queue-a-signed-exchange-report">2.4. Monkeypatch HTTP fetch</a>
    <li><a href="#ref-for-queue-a-signed-exchange-report①">4.15. Wait and queue a report</a> <a href="#ref-for-queue-a-signed-exchange-report②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="new-read-buffer">
   <b><a href="#new-read-buffer">#new-read-buffer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-new-read-buffer">4.2. Extracting the fallback URL</a>
    <li><a href="#ref-for-new-read-buffer①">4.3. Parsing signed exchanges</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-buffer-reading-up-to">
   <b><a href="#read-buffer-reading-up-to">#read-buffer-reading-up-to</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-buffer-reading-up-to">4.17.3. Read bytes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-buffer-read">
   <b><a href="#read-buffer-read">#read-buffer-read</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-buffer-read">4.3. Parsing signed exchanges</a> <a href="#ref-for-read-buffer-read①">(2)</a> <a href="#ref-for-read-buffer-read②">(3)</a> <a href="#ref-for-read-buffer-read③">(4)</a>
    <li><a href="#ref-for-read-buffer-read④">4.4. Parsing the invariant prefix</a> <a href="#ref-for-read-buffer-read⑤">(2)</a> <a href="#ref-for-read-buffer-read⑥">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-buffer-dump">
   <b><a href="#read-buffer-dump">#read-buffer-dump</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-buffer-dump">4.12. Creating the response stream.</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>